storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [02/11] storm git commit: STORM-845 Storm ElasticSearch connector
Date Wed, 05 Aug 2015 22:58:47 GMT
STORM-845 Storm ElasticSearch connector


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/0c00544b
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/0c00544b
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/0c00544b

Branch: refs/heads/master
Commit: 0c00544ba72339c18d60dffd5e27e5f982ddb649
Parents: 2002dbd
Author: SEUNGJIN LEE <sweetest.sj@navercorp.com>
Authored: Tue Jun 23 18:35:44 2015 +0900
Committer: SEUNGJIN LEE <sweetest.sj@navercorp.com>
Committed: Thu Jul 23 14:32:17 2015 +0900

----------------------------------------------------------------------
 external/storm-elasticsearch/README.md                | 14 +++++++-------
 external/storm-elasticsearch/pom.xml                  |  2 +-
 .../storm/elasticsearch/bolt/AbstractEsBolt.java      |  6 +++---
 .../apache/storm/elasticsearch/trident/EsState.java   |  6 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/0c00544b/external/storm-elasticsearch/README.md
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/README.md b/external/storm-elasticsearch/README.md
index 20caece..3fa1592 100644
--- a/external/storm-elasticsearch/README.md
+++ b/external/storm-elasticsearch/README.md
@@ -1,11 +1,11 @@
-# Storm ElasticSearch Bolt & Trident State
+# Storm Elasticsearch Bolt & Trident State
 
-  EsIndexBolt, EsPercolateBolt and EsState allows users to stream data from storm into ElasticSearch
directly.
+  EsIndexBolt, EsPercolateBolt and EsState allows users to stream data from storm into Elasticsearch
directly.
   For detailed description, please refer to the following.   
 
 ## EsIndexBolt (org.apache.storm.elasticsearch.bolt.EsIndexBolt)
 
-EsIndexBolt streams tuples directly into ElasticSearch. Tuples are indexed in specified index
& type combination. 
+EsIndexBolt streams tuples directly into Elasticsearch. Tuples are indexed in specified index
& type combination. 
 User should make sure that there are "index","type", and "source" fields declared in preceding
bolts or spout.
 "index" and "type" fields are used for identifying target index and type.
 "source" is a document in JSON format string that will be indexed in elastic search.
@@ -19,7 +19,7 @@ EsIndexBolt indexBolt = new IndexBolt(esConfig);
 
 ## EsPercolateBolt (org.apache.storm.elasticsearch.bolt.EsPercolateBolt)
 
-EsPercolateBolt streams tuples directly into ElasticSearch. Tuples are used to send percolate
request to specified index & type combination. 
+EsPercolateBolt streams tuples directly into Elasticsearch. Tuples are used to send percolate
request to specified index & type combination. 
 User should make sure that there are "index","type", and "source" fields declared in preceding
bolts or spout.
 "index" and "type" fields are used for identifying target index and type.
 "source" is a document in JSON format string that will be sent in percolate request to elastic
search.
@@ -45,14 +45,14 @@ EsConfig params
 
 |Arg  |Description | Type
 |---	|--- |---
-|clusterName | ElasticSearch cluster name | String (required) |
-|nodes | ElasticSearch nodes in a String array, each element should follow {host}:{port}
pattern | String array (required) |
+|clusterName | Elasticsearch cluster name | String (required) |
+|nodes | Elasticsearch nodes in a String array, each element should follow {host}:{port}
pattern | String array (required) |
 
 
  
 ## EsState (org.apache.storm.elasticsearch.trident.EsState)
 
-ElasticSearch Trident state also follows similar pattern to EsBolts. It takes in EsConfig
as an arg.
+Elasticsearch Trident state also follows similar pattern to EsBolts. It takes in EsConfig
as an arg.
 
 ```code
    EsConfig esConfig = new EsConfig();

http://git-wip-us.apache.org/repos/asf/storm/blob/0c00544b/external/storm-elasticsearch/pom.xml
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/pom.xml b/external/storm-elasticsearch/pom.xml
index b1b069b..88ea312 100644
--- a/external/storm-elasticsearch/pom.xml
+++ b/external/storm-elasticsearch/pom.xml
@@ -36,7 +36,7 @@
     </developers>
 
     <properties>
-        <elasticsearch.version>1.5.2</elasticsearch.version>
+        <elasticsearch.version>1.6.0</elasticsearch.version>
     </properties>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/storm/blob/0c00544b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/AbstractEsBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/AbstractEsBolt.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/AbstractEsBolt.java
index 1e2d1ed..ff1b543 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/AbstractEsBolt.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/AbstractEsBolt.java
@@ -37,8 +37,8 @@ import java.util.Map;
 
 public abstract class AbstractEsBolt extends BaseRichBolt {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractEsBolt.class);
-    protected OutputCollector collector;
     protected static Client client;
+    protected OutputCollector collector;
     private EsConfig esConfig;
 
     public AbstractEsBolt(EsConfig esConfig) {
@@ -53,12 +53,12 @@ public abstract class AbstractEsBolt extends BaseRichBolt {
                 if (client == null) {
                     Settings settings =
                             ImmutableSettings.settingsBuilder().put("cluster.name", esConfig.getClusterName())
-                                    .put("client.transport.sniff", "false").build();
+                                    .put("client.transport.sniff", "true").build();
                     List<InetSocketTransportAddress> transportAddressList = new ArrayList<InetSocketTransportAddress>();
                     for (String node : esConfig.getNodes()) {
                         String[] hostAndPort = node.split(":");
                         if(hostAndPort.length != 2){
-                            throw new Exception("incorrect ElasticSearch node format, should
follow {host}:{port} pattern");
+                            throw new IllegalArgumentException("incorrect Elasticsearch node
format, should follow {host}:{port} pattern");
                         }
                         transportAddressList.add(new InetSocketTransportAddress(hostAndPort[0],
Integer.parseInt(hostAndPort[1])));
                     }

http://git-wip-us.apache.org/repos/asf/storm/blob/0c00544b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsState.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsState.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsState.java
index ee95355..58de6cc 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsState.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsState.java
@@ -38,9 +38,9 @@ import java.util.List;
 import java.util.Map;
 
 public class EsState implements State {
-    private EsConfig esConfig;
-    private static Client client;
     private static final Logger LOG = LoggerFactory.getLogger(EsState.class);
+    private static Client client;
+    private EsConfig esConfig;
 
     public EsState(EsConfig esConfig) {
         this.esConfig = esConfig;
@@ -67,7 +67,7 @@ public class EsState implements State {
                     for (String node : esConfig.getNodes()) {
                         String[] hostAndPort = node.split(":");
                         if (hostAndPort.length != 2) {
-                            throw new Exception("incorrect ElasticSearch node format, should
follow {host}:{port} pattern");
+                            throw new IllegalArgumentException("incorrect Elasticsearch node
format, should follow {host}:{port} pattern");
                         }
                         transportAddressList.add(new InetSocketTransportAddress(hostAndPort[0],
Integer.parseInt(hostAndPort[1])));
                     }


Mime
View raw message