You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2015/08/28 00:12:55 UTC

[11/13] storm git commit: Make ES lookup bolt dependency interfaces Serializable, add javadoc and more README

Make ES lookup bolt dependency interfaces Serializable, add javadoc and more README


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

Branch: refs/heads/master
Commit: 8618eb336e4e84aa3aaf03f3418c9ec40be0ea1f
Parents: 69c78ca
Author: Alex Panov <al...@teradata.com>
Authored: Fri Aug 21 12:39:30 2015 +0200
Committer: Alex Panov <al...@teradata.com>
Committed: Fri Aug 21 12:39:30 2015 +0200

----------------------------------------------------------------------
 external/storm-elasticsearch/README.md                 |  7 ++++++-
 .../storm/elasticsearch/ElasticsearchGetRequest.java   | 11 ++++++++++-
 .../storm/elasticsearch/EsLookupResultOutput.java      | 13 ++++++++++++-
 3 files changed, 28 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/8618eb33/external/storm-elasticsearch/README.md
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/README.md b/external/storm-elasticsearch/README.md
index 04a3673..1b18019 100644
--- a/external/storm-elasticsearch/README.md
+++ b/external/storm-elasticsearch/README.md
@@ -36,7 +36,12 @@ for each Percolate.Match in PercolateResponse.
 
 ## EsLookupBolt (org.apache.storm.elasticsearch.bolt.EsLookupBolt)
 
-EsLookupBolt performs a get request to Elasticsearch. Incoming tuple is passed to provided GetRequest creator and the result of that execution is passed to Elasticsearch client.
+EsLookupBolt performs a get request to Elasticsearch. 
+In order to do that, three dependencies need to be satisfied. Apart from usual EsConfig, two other dependencies must be provided:
+    ElasticsearchGetRequest is used to convert the incoming Tuple to the GetRequest that will be executed against Elasticsearch.
+    EsLookupResultOutput is used to declare the output fields and convert the GetResponse to values that are emited by the bolt.
+
+Incoming tuple is passed to provided GetRequest creator and the result of that execution is passed to Elasticsearch client.
 The bolt then uses the provider output adapter (EsLookupResultOutput) to convert the GetResponse to Values to emit.
 The output fields are also specified by the user of the bolt via the output adapter (EsLookupResultOutput).
 

http://git-wip-us.apache.org/repos/asf/storm/blob/8618eb33/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/ElasticsearchGetRequest.java
----------------------------------------------------------------------
diff --git a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/ElasticsearchGetRequest.java b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/ElasticsearchGetRequest.java
index 098c993..6a7ce61 100644
--- a/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/ElasticsearchGetRequest.java
+++ b/external/storm-elasticsearch/src/main/java/org/apache/storm/elasticsearch/ElasticsearchGetRequest.java
@@ -17,11 +17,20 @@
  */
 package org.apache.storm.elasticsearch;
 
+import java.io.Serializable;
+
 import org.elasticsearch.action.get.GetRequest;
 
 import backtype.storm.tuple.ITuple;
 
-public interface ElasticsearchGetRequest {
+/**
+ * @since 0.11
+ * The adapter to convert the incoming tuple to Elasticsearch GetRequest.
+ */
+public interface ElasticsearchGetRequest extends Serializable {
 
+    /**
+     * @return GetRequest to perform against Elasticsearch.
+     */
     GetRequest extractFrom(ITuple tuple);
 }

http://git-wip-us.apache.org/repos/asf/storm/blob/8618eb33/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 68d7dba..9ccb9e6 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
@@ -17,6 +17,7 @@
  */
 package org.apache.storm.elasticsearch;
 
+import java.io.Serializable;
 import java.util.Collection;
 
 import org.elasticsearch.action.get.GetResponse;
@@ -24,9 +25,19 @@ import org.elasticsearch.action.get.GetResponse;
 import backtype.storm.tuple.Fields;
 import backtype.storm.tuple.Values;
 
-public interface EsLookupResultOutput {
+/**
+ * @since 0.11
+ * The adapter to convert the results fetched from Elasticsearch to values.
+ */
+public interface EsLookupResultOutput extends Serializable {
 
+    /**
+     * @return collection of values to emit.
+     */
     Collection<Values> toValues(GetResponse response);
 
+    /**
+     * @return output fields to declare.
+     */
     Fields fields();
 }