Github user tzulitai commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5761#discussion_r176996131
  
    --- Diff: 
flink-examples/flink-examples-streaming/src/main/java/org/apache/flink/streaming/examples/elasticsearch/Elasticsearch1Example.java
 ---
    @@ -37,20 +39,36 @@
     import java.util.Map;
     
     /**
    - * This example shows how to use the Elasticsearch Sink. Before running it 
you must ensure that
    - * you have a cluster named "elasticsearch" running or change the cluster 
name in the config map.
    + * End to end test for elasticsearch1.
    + *
    + * <p>This example shows how to use the Elasticsearch Sink from an user 
endpoint. Before running it you
    + * must ensure that you have a cluster named "elasticsearch" running or 
change the cluster name in the config map.
    + *
    + * <p>Example usage:
    + *         --index my-index-person --type my-type-spiderman
      */
    -@SuppressWarnings("serial")
    -public class ElasticsearchSinkExample {
    +public class Elasticsearch1Example {
     
        public static void main(String[] args) throws Exception {
     
    +           final ParameterTool parameterTool = 
ParameterTool.fromArgs(args);
    +
    +           if (parameterTool.getNumberOfParameters() < 2) {
    +                   System.out.println("Missing parameters!\n" +
    +                                   "Usage: --index <my-index-person> 
--type <my-type-spiderman>");
    +                   return;
    +           }
    +
                StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
    +           env.getConfig().disableSysoutLogging();
    +           
env.getConfig().setRestartStrategy(RestartStrategies.fixedDelayRestart(3, 
10000));
    +           env.enableCheckpointing(5000);
    +           env.getConfig().setGlobalJobParameters(parameterTool);
    --- End diff --
    
    Is this necessary?
    



---

Reply via email to