flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhue...@apache.org
Subject [4/4] flink git commit: [FLINK-3882] [docs] Fix errors in sample Java code for the Elasticsearch2 sink
Date Tue, 10 May 2016 20:31:17 GMT
[FLINK-3882] [docs] Fix errors in sample Java code for the Elasticsearch2 sink

This closes #1971


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/43bd6f6e
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/43bd6f6e
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/43bd6f6e

Branch: refs/heads/master
Commit: 43bd6f6e4020d4102c34c5874ddfa850a281c8c8
Parents: 08e8054
Author: markreddy <mark.l.reddy@gmail.com>
Authored: Sun May 8 21:41:13 2016 +0100
Committer: Fabian Hueske <fhueske@apache.org>
Committed: Tue May 10 18:59:57 2016 +0200

----------------------------------------------------------------------
 docs/apis/streaming/connectors/elasticsearch2.md | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/43bd6f6e/docs/apis/streaming/connectors/elasticsearch2.md
----------------------------------------------------------------------
diff --git a/docs/apis/streaming/connectors/elasticsearch2.md b/docs/apis/streaming/connectors/elasticsearch2.md
index 74650ec..7146285 100644
--- a/docs/apis/streaming/connectors/elasticsearch2.md
+++ b/docs/apis/streaming/connectors/elasticsearch2.md
@@ -78,20 +78,19 @@ transports.add(new InetSocketAddress(InetAddress.getByName("127.0.0.1"),
9300));
 transports.add(new InetSocketAddress(InetAddress.getByName("10.2.3.1"), 9300));
 
 input.addSink(new ElasticsearchSink(config, transports, new ElasticsearchSinkFunction<String>()
{
-  public IndexRequest createIndexRequest(String element): IndexRequest = {
-    Map<String,String> json = new HashMap<>()
-    json.put("data", element)
+  public IndexRequest createIndexRequest(String element) {
+    Map<String, String> json = new HashMap<>();
+    json.put("data", element);
 
     return Requests.indexRequest()
             .index("my-index")
             .type("my-type")
             .source(json);
-
   }
-  
+
   @Override
   public void process(String element, RuntimeContext ctx, RequestIndexer indexer) {
-    indexer.add(createIndexRequest(element))
+    indexer.add(createIndexRequest(element));
   }
 }));
 {% endhighlight %}
@@ -116,10 +115,10 @@ input.addSink(new ElasticsearchSink(config, transports, new ElasticsearchSinkFun
     json.put("data", element)
     Requests.indexRequest.index("my-index").`type`("my-type").source(json)
   }
-  
+
   override def process(element: String, ctx: RuntimeContext, indexer: RequestIndexer) {
     indexer.add(createIndexRequest(element))
-  } 
+  }
 }))
 {% endhighlight %}
 </div>
@@ -139,7 +138,7 @@ This will buffer elements and Action Requests before sending to the cluster.
The
  * **bulk.flush.interval.ms**: Interval at which to flush data regardless of the other two
   settings in milliseconds
 
-This now provides a list of Elasticsearch Nodes 
+This now provides a list of Elasticsearch Nodes
 to which the sink should connect via a `TransportClient`.
 
 More about information about Elasticsearch can be found [here](https://elastic.co).


Mime
View raw message