storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/2] storm git commit: STORM-2578: Apply new code style to storm-elasticsearch
Date Mon, 20 Aug 2018 05:16:12 GMT
Repository: storm
Updated Branches:
  refs/heads/master 2875c838a -> 518f94703


STORM-2578: Apply new code style to storm-elasticsearch


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

Branch: refs/heads/master
Commit: 8bbee40c3c2426aea9028290296cd758c3a3b567
Parents: 88d19b0
Author: Jing Chen <milantracy@gmail.com>
Authored: Wed Aug 15 13:34:57 2018 -0700
Committer: Jing Chen <milantracy@gmail.com>
Committed: Fri Aug 17 18:41:57 2018 -0700

----------------------------------------------------------------------
 external/storm-elasticsearch/pom.xml            |  2 +-
 .../DefaultEsLookupResultOutput.java            | 11 +++++++---
 .../elasticsearch/EsLookupResultOutput.java     |  8 +++++++-
 .../elasticsearch/bolt/AbstractEsBolt.java      |  7 ++++---
 .../storm/elasticsearch/bolt/EsIndexBolt.java   |  5 +++--
 .../storm/elasticsearch/bolt/EsLookupBolt.java  | 12 ++++++-----
 .../elasticsearch/bolt/EsPercolateBolt.java     |  8 +++++---
 .../common/DefaultEsTupleMapper.java            |  2 +-
 .../storm/elasticsearch/common/EsConfig.java    |  8 +++++---
 .../elasticsearch/common/EsTupleMapper.java     |  5 +++--
 .../common/StormElasticSearchClient.java        |  9 +++++++++
 .../apache/storm/elasticsearch/doc/Index.java   |  8 ++++++++
 .../storm/elasticsearch/doc/IndexDoc.java       |  1 +
 .../storm/elasticsearch/doc/IndexItem.java      |  1 +
 .../storm/elasticsearch/doc/IndexItemDoc.java   |  1 +
 .../apache/storm/elasticsearch/doc/Shards.java  |  1 +
 .../storm/elasticsearch/doc/SourceDoc.java      |  1 +
 .../response/BulkIndexResponse.java             | 11 ++++++++++
 .../elasticsearch/response/LookupResponse.java  |  5 +++--
 .../response/PercolateResponse.java             |  5 +++--
 .../storm/elasticsearch/trident/EsState.java    | 21 ++++++++------------
 .../elasticsearch/trident/EsStateFactory.java   |  4 +++-
 .../storm/elasticsearch/trident/EsUpdater.java  |  5 +++--
 23 files changed, 97 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/pom.xml
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/pom.xml b/external/storm-elasticsearch/pom.xml
index 3386fbd..2394bbb 100644
--- a/external/storm-elasticsearch/pom.xml
+++ b/external/storm-elasticsearch/pom.xml
@@ -139,7 +139,7 @@
                 <artifactId>maven-checkstyle-plugin</artifactId>
                 <!--Note - the version would be inherited-->
                 <configuration>
-                    <maxAllowedViolations>69</maxAllowedViolations>
+                    <maxAllowedViolations>0</maxAllowedViolations>
                 </configuration>
             </plugin>
         </plugins>

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/DefaultEsLookupResultOutput.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/DefaultEsLookupResultOutput.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/DefaultEsLookupResultOutput.java
index 533dc65..d25bead 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/DefaultEsLookupResultOutput.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/DefaultEsLookupResultOutput.java
@@ -15,8 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
@@ -26,8 +29,6 @@ import org.apache.storm.tuple.Fields;
 import org.apache.storm.tuple.Values;
 import org.elasticsearch.client.Response;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
 /**
  * Default implementation of {@link EsLookupResultOutput}.
  * Outputs the index, type, id and source as strings.
@@ -51,7 +52,11 @@ public class DefaultEsLookupResultOutput implements EsLookupResultOutput
{
         } catch (UnsupportedOperationException | IOException e) {
             throw new IllegalArgumentException("Response " + response + " is invalid", e);
         }
-        return Collections.singleton(new Values(lookupResponse.getIndex(), lookupResponse.getType(),
lookupResponse.getId(), lookupResponse.getSource()));
+        return Collections.singleton(new Values(
+                lookupResponse.getIndex(),
+                lookupResponse.getType(),
+                lookupResponse.getId(),
+                lookupResponse.getSource()));
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/EsLookupResultOutput.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/EsLookupResultOutput.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/EsLookupResultOutput.java
index b057729..71e250d 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/EsLookupResultOutput.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/EsLookupResultOutput.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch;
 
 import java.io.Serializable;
@@ -25,17 +26,22 @@ import org.apache.storm.tuple.Values;
 import org.elasticsearch.client.Response;
 
 /**
- * @since 0.11
  * The adapter to convert the results fetched from Elasticsearch to values.
+ *
+ * @since 0.11
  */
 public interface EsLookupResultOutput extends Serializable {
 
     /**
+     * Convert Elasticsearch response to a collection of {@link Values}.
+     *
      * @return collection of values to emit.
      */
     Collection<Values> toValues(Response response);
 
     /**
+     * {@link Fields} to be declared for output.
+     *
      * @return output fields to declare.
      */
     Fields fields();

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/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 a819f65..5612e70 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
@@ -15,11 +15,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.bolt;
 
 import static java.util.Objects.requireNonNull;
 import static org.apache.http.util.Args.notBlank;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+
 import java.util.Map;
 
 import org.apache.storm.elasticsearch.common.EsConfig;
@@ -32,14 +35,12 @@ import org.elasticsearch.client.RestClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
 public abstract class AbstractEsBolt extends BaseTickTupleAwareRichBolt {
 
     private static final Logger LOG = LoggerFactory.getLogger(AbstractEsBolt.class);
 
     protected static RestClient client;
-    protected final static ObjectMapper objectMapper = new ObjectMapper();
+    protected static final ObjectMapper objectMapper = new ObjectMapper();
 
     protected OutputCollector collector;
     private EsConfig esConfig;

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsIndexBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsIndexBolt.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsIndexBolt.java
index 9145a1b..6d46863 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsIndexBolt.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsIndexBolt.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.bolt;
 
 import static java.util.Objects.requireNonNull;
@@ -38,7 +39,7 @@ public class EsIndexBolt extends AbstractEsBolt {
     private final EsTupleMapper tupleMapper;
 
     /**
-     * EsIndexBolt constructor
+     * EsIndexBolt constructor.
      * @param esConfig Elasticsearch configuration containing node addresses {@link EsConfig}
      */
     public EsIndexBolt(EsConfig esConfig) {
@@ -46,7 +47,7 @@ public class EsIndexBolt extends AbstractEsBolt {
     }
 
     /**
-     * EsIndexBolt constructor
+     * EsIndexBolt constructor.
      * @param esConfig Elasticsearch configuration containing node addresses {@link EsConfig}
      * @param tupleMapper Tuple to ES document mapper {@link EsTupleMapper}
      */

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsLookupBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsLookupBolt.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsLookupBolt.java
index 1ff4686..5faa69f 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsLookupBolt.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsLookupBolt.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.bolt;
 
 import static java.util.Objects.requireNonNull;
@@ -35,6 +36,7 @@ import org.apache.storm.tuple.Values;
 import org.elasticsearch.client.Response;
 
 /**
+ * Basic bolt for looking up document in ES.
  * @since 0.11
  */
 public class EsLookupBolt extends AbstractEsBolt {
@@ -76,12 +78,12 @@ public class EsLookupBolt extends AbstractEsBolt {
     }
 
     private Collection<Values> lookupValuesInEs(Tuple tuple) throws IOException {
-    	String index = tupleMapper.getIndex(tuple);
-    	String type = tupleMapper.getType(tuple);
-    	String id = tupleMapper.getId(tuple);
-    	Map<String, String> params = tupleMapper.getParams(tuple, new HashMap<>());
+        String index = tupleMapper.getIndex(tuple);
+        String type = tupleMapper.getType(tuple);
+        String id = tupleMapper.getId(tuple);
+        Map<String, String> params = tupleMapper.getParams(tuple, new HashMap<>());
 
-    	Response response = client.performRequest("get", getEndpoint(index, type, id), params);
+        Response response = client.performRequest("get", getEndpoint(index, type, id), params);
         return output.toValues(response);
     }
 

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsPercolateBolt.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsPercolateBolt.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsPercolateBolt.java
index ac9e07a..3f831f7 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsPercolateBolt.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/bolt/EsPercolateBolt.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.bolt;
 
 import static java.util.Objects.requireNonNull;
@@ -43,7 +44,7 @@ public class EsPercolateBolt extends AbstractEsBolt {
     private final EsTupleMapper tupleMapper;
 
     /**
-     * EsPercolateBolt constructor
+     * EsPercolateBolt constructor.
      * @param esConfig Elasticsearch configuration containing node addresses {@link EsConfig}
      */
     public EsPercolateBolt(EsConfig esConfig) {
@@ -51,7 +52,7 @@ public class EsPercolateBolt extends AbstractEsBolt {
     }
 
     /**
-     * EsPercolateBolt constructor
+     * EsPercolateBolt constructor.
      * @param esConfig Elasticsearch configuration containing node addresses and cluster
name {@link EsConfig}
      * @param tupleMapper Tuple to ES document mapper {@link EsTupleMapper}
      */
@@ -81,7 +82,8 @@ public class EsPercolateBolt extends AbstractEsBolt {
             Map<String, String> indexParams = new HashMap<>();
             indexParams.put(type, null);
             String percolateDoc = "{\"doc\": " + source + "}";
-            Response response = client.performRequest("get", getEndpoint(index, type, "_percolate"),
new HashMap<>(), new StringEntity(percolateDoc));
+            Response response = client.performRequest("get", getEndpoint(index, type, "_percolate"),
+                    new HashMap<>(), new StringEntity(percolateDoc));
             PercolateResponse percolateResponse = objectMapper.readValue(response.getEntity().getContent(),
PercolateResponse.class);
             if (!percolateResponse.getMatches().isEmpty()) {
                 for (PercolateResponse.Match match : percolateResponse.getMatches()) {

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/DefaultEsTupleMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/DefaultEsTupleMapper.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/DefaultEsTupleMapper.java
index c8d750d..af4f4e9 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/DefaultEsTupleMapper.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/DefaultEsTupleMapper.java
@@ -15,11 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.common;
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.stream.Collectors;
 
 import org.apache.storm.tuple.ITuple;
 

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsConfig.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsConfig.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsConfig.java
index 02f045d..c665ae4 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsConfig.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsConfig.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.common;
 
 import java.io.Serializable;
@@ -28,6 +29,7 @@ import org.elasticsearch.client.RestClientBuilder.HttpClientConfigCallback;
 import org.elasticsearch.client.RestClientBuilder.RequestConfigCallback;
 
 /**
+ * Configuration for Elasticsearch connection.
  * @since 0.11
  */
 public class EsConfig implements Serializable {
@@ -49,7 +51,7 @@ public class EsConfig implements Serializable {
     }
 
     /**
-     * EsConfig Constructor to be used in EsIndexBolt, EsPercolateBolt and EsStateFactory
+     * EsConfig Constructor to be used in EsIndexBolt, EsPercolateBolt and EsStateFactory.
      *
      * @param urls Elasticsearch addresses in scheme://host:port pattern string array
      * @throws IllegalArgumentException if urls are empty
@@ -61,12 +63,12 @@ public class EsConfig implements Serializable {
         }
         this.httpHosts = new HttpHost[urls.length];
         for (int i = 0; i < urls.length; i++) {
-            URI uri = toURI(urls[i]);
+            URI uri = toUri(urls[i]);
             this.httpHosts[i] = new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme());
         }
     }
 
-    static URI toURI(String url) throws IllegalArgumentException {
+    static URI toUri(String url) throws IllegalArgumentException {
         try {
             return new URI(url);
         } catch (URISyntaxException e) {

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsTupleMapper.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsTupleMapper.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsTupleMapper.java
index 285e112..ab658da 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsTupleMapper.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/EsTupleMapper.java
@@ -15,13 +15,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.storm.elasticsearch.common;
 
-import org.apache.storm.tuple.ITuple;
+package org.apache.storm.elasticsearch.common;
 
 import java.io.Serializable;
 import java.util.Map;
 
+import org.apache.storm.tuple.ITuple;
+
 /**
  * TupleMapper defines how to extract source, index, type, and id from tuple for ElasticSearch.
  */

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/StormElasticSearchClient.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/StormElasticSearchClient.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/StormElasticSearchClient.java
index a4aca59..732aa08 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/StormElasticSearchClient.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/common/StormElasticSearchClient.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.common;
 
 import java.io.Serializable;
@@ -22,6 +23,9 @@ import java.io.Serializable;
 import org.elasticsearch.client.RestClient;
 import org.elasticsearch.client.RestClientBuilder;
 
+/**
+ * Client for connecting Elasticsearch.
+ */
 public final class StormElasticSearchClient implements Serializable {
 
     private final EsConfig esConfig;
@@ -30,6 +34,11 @@ public final class StormElasticSearchClient implements Serializable {
         this.esConfig = esConfig;
     }
 
+    /**
+     * Creates a new {@link RestClient} using given {@link EsConfig}.
+     *
+     * @return {@link RestClient} for Elasticsearch connection
+     */
     public RestClient construct() {
         RestClientBuilder builder = RestClient.builder(esConfig.getHttpHosts());
         if (esConfig.getMaxRetryTimeoutMillis() != null) {

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Index.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Index.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Index.java
index d010abe..463061f 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Index.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Index.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.doc;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
@@ -28,6 +29,13 @@ public class Index {
 
     }
 
+    /**
+     * Create a Index with the specified index, type and id.
+     *
+     * @param index index name
+     * @param type  document type to be stored
+     * @param id    unique document id in Elasticsearch
+     */
     public Index(String index, String type, String id) {
         this.index = index;
         this.type = type;

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexDoc.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexDoc.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexDoc.java
index c695638..1ea2b4b 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexDoc.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexDoc.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.doc;
 
 /**

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItem.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItem.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItem.java
index e04c48e..c35dfe4 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItem.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItem.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.doc;
 
 import com.fasterxml.jackson.annotation.JsonProperty;

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItemDoc.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItemDoc.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItemDoc.java
index 60a330e..a7bf789 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItemDoc.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/IndexItemDoc.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.doc;
 
 /**

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Shards.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Shards.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Shards.java
index 98cc702..1bc7e66 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Shards.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/Shards.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.doc;
 
 import java.util.List;

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/SourceDoc.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/SourceDoc.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/SourceDoc.java
index ea30e65..6813d4d 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/SourceDoc.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/doc/SourceDoc.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.doc;
 
 /**

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/BulkIndexResponse.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/BulkIndexResponse.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/BulkIndexResponse.java
index 7131e63..a0f40c8 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/BulkIndexResponse.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/BulkIndexResponse.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.response;
 
 import java.util.List;
@@ -58,6 +59,11 @@ public class BulkIndexResponse {
         this.items = items;
     }
 
+    /**
+     * Retrieve first error's code from response.
+     *
+     * @return error status code
+     */
     public Integer getFirstError() {
         if (items == null || items.isEmpty()) {
             return null;
@@ -71,6 +77,11 @@ public class BulkIndexResponse {
         return null;
     }
 
+    /**
+     * Retrieve first result from response.
+     *
+     * @return result text
+     */
     public String getFirstResult() {
         if (items == null || items.isEmpty()) {
             return null;

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/LookupResponse.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/LookupResponse.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/LookupResponse.java
index 8b6b24d..99730f7 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/LookupResponse.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/LookupResponse.java
@@ -15,14 +15,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.storm.elasticsearch.response;
 
-import org.apache.storm.elasticsearch.doc.Index;
+package org.apache.storm.elasticsearch.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonRawValue;
 import com.fasterxml.jackson.databind.JsonNode;
 
+import org.apache.storm.elasticsearch.doc.Index;
+
 /**
  * Mapped response for document lookup.
  */

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/PercolateResponse.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/PercolateResponse.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/PercolateResponse.java
index 87bc004..df67134 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/PercolateResponse.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/response/PercolateResponse.java
@@ -15,14 +15,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.response;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
+
 import java.util.List;
 
 import org.apache.storm.elasticsearch.doc.Shards;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-
 /**
  * Mapped response for percolate.
  */

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/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 fb34407..86863d7 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
@@ -15,10 +15,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.trident;
 
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.util.HashMap;
 import java.util.List;
 
@@ -38,9 +41,6 @@ import org.elasticsearch.client.RestClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
 /**
  * Trident State for storing tuple to ES document.
  * @since 0.11
@@ -53,7 +53,8 @@ class EsState implements State {
     private EsTupleMapper tupleMapper;
 
     /**
-     * EsState constructor
+     * EsState constructor.
+     *
      * @param esConfig Elasticsearch configuration containing node addresses and cluster
name {@link EsConfig}
      * @param tupleMapper Tuple to ES document mapper {@link EsTupleMapper}
      */
@@ -64,11 +65,9 @@ class EsState implements State {
     }
 
     /**
-     * @param txid
-     *
      * Elasticsearch index requests with same id will result in update operation
      * which means if same tuple replays, only one record will be stored in elasticsearch
for same document
-     * without control with txid
+     * without control with txid.
      */
     @Override
     public void beginCommit(Long txid) {
@@ -76,11 +75,9 @@ class EsState implements State {
     }
 
     /**
-     * @param txid
-     *
      * Elasticsearch index requests with same id will result in update operation
      * which means if same tuple replays, only one record will be stored in elasticsearch
for same document
-     * without control with txid
+     * without control with txid.
      */
     @Override
     public void commit(Long txid) {
@@ -121,8 +118,6 @@ class EsState implements State {
      *
      * @param tuples list of tuples for storing to ES.
      *               Each tuple should have relevant fields (source, index, type, id) for
EsState's tupleMapper to extract ES document.
-     * @throws IOException
-     * @throws UnsupportedEncodingException
      */
     public void updateState(List<TridentTuple> tuples) {
         try {

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsStateFactory.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsStateFactory.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsStateFactory.java
index 8d7a6aa..d79ec2e 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsStateFactory.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsStateFactory.java
@@ -15,6 +15,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.trident;
 
 import static java.util.Objects.requireNonNull;
@@ -36,7 +37,8 @@ public class EsStateFactory implements StateFactory {
     private final EsTupleMapper tupleMapper;
 
     /**
-     * EsStateFactory constructor
+     * EsStateFactory constructor.
+     *
      * @param esConfig Elasticsearch configuration containing node addresses and cluster
name {@link EsConfig}
      * @param tupleMapper Tuple to ES document mapper {@link EsTupleMapper}
      */

http://git-wip-us.apache.org/repos/asf/storm/blob/8bbee40c/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsUpdater.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsUpdater.java
b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsUpdater.java
index 37c213d..30f296c 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsUpdater.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/trident/EsUpdater.java
@@ -15,14 +15,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.storm.elasticsearch.trident;
 
+import java.util.List;
+
 import org.apache.storm.trident.operation.TridentCollector;
 import org.apache.storm.trident.state.BaseStateUpdater;
 import org.apache.storm.trident.tuple.TridentTuple;
 
-import java.util.List;
-
 public class EsUpdater extends BaseStateUpdater<EsState> {
     /**
      * {@inheritDoc}


Mime
View raw message