[ https://issues.apache.org/jira/browse/FLINK-9008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16451966#comment-16451966 ]
ASF GitHub Bot commented on FLINK-9008: --------------------------------------- Github user zhangminglei commented on a diff in the pull request: https://github.com/apache/flink/pull/5823#discussion_r183999361 --- Diff: flink-end-to-end-tests/test-scripts/test-class/ElasticsearchStreamingJob.java --- @@ -0,0 +1,90 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.quickstart; + +import org.apache.flink.api.common.functions.MapFunction; +import org.apache.flink.api.common.functions.RuntimeContext; +import org.apache.flink.streaming.api.datastream.DataStream; +import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; +import org.apache.flink.streaming.connectors.elasticsearch2.ElasticsearchSink; +import org.apache.flink.streaming.connectors.elasticsearch.ElasticsearchSinkFunction; + +import org.elasticsearch.action.index.IndexRequest; +import org.elasticsearch.client.Requests; + +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Elasticsearch example for Flink Streaming Job. + * + * <p>In this streaming job, we generate a bunch of data from numbers, apply operator map + * made a type conversion. Then we choose elasticsearch as its sink to storage these data. + * + * <p>Run test_quickstarts.sh to verify this program. Package this class to a jar, verify the jar, + * then deploy it on a flink cluster. + */ +public class ElasticsearchStreamingJob { + + public static void main(String[] args) throws Exception { + // set up the streaming execution environment + final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); + + DataStream<String> source = env.generateSequence(0, 20) + .map(new MapFunction<Long, String>() { + @Override + public String map(Long value) throws Exception { + return value.toString(); + }}); + + --- End diff -- will change. > End-to-end test: Quickstarts > ---------------------------- > > Key: FLINK-9008 > URL: https://issues.apache.org/jira/browse/FLINK-9008 > Project: Flink > Issue Type: Sub-task > Components: Quickstarts, Tests > Affects Versions: 1.5.0 > Reporter: Till Rohrmann > Assignee: mingleizhang > Priority: Critical > Fix For: 1.5.0 > > > We could add an end-to-end test which verifies Flink's quickstarts. It should > do the following: > # create a new Flink project using the quickstarts archetype > # add a new Flink dependency to the {{pom.xml}} (e.g. Flink connector or > library) > # run {{mvn clean package -Pbuild-jar}} > # verify that no core dependencies are contained in the jar file > # Run the program -- This message was sent by Atlassian JIRA (v7.6.3#76005)