Package org.apache.flink.streaming.api.environment

Examples of org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource()


  // Example for connecting data streams
  public static void main(String[] args) throws Exception {
    StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironment(
        PARALLELISM).setBufferTimeout(100);

    DataStream<Tuple3<Integer, Long, Integer>> querySource = env.addSource(new QuerySource(),
        SOURCE_PARALLELISM).partitionBy(0);

    DataStream<String> stream = env.addSource(new InfoSource(), SOURCE_PARALLELISM)
        .partitionBy(0).connect(querySource).map(new CellTask());
    stream.print();
View Full Code Here


        PARALLELISM).setBufferTimeout(100);

    DataStream<Tuple3<Integer, Long, Integer>> querySource = env.addSource(new QuerySource(),
        SOURCE_PARALLELISM).partitionBy(0);

    DataStream<String> stream = env.addSource(new InfoSource(), SOURCE_PARALLELISM)
        .partitionBy(0).connect(querySource).map(new CellTask());
    stream.print();

    env.execute();
  }
View Full Code Here

  public static void main(String[] args) throws Exception {

    StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironment(
        PARALLELISM).setBufferTimeout(100);

    DataStream<Tuple3<String, Integer, Long>> grades = env.addSource(new GradeSource(),
        SOURCE_PARALLELISM);

    DataStream<Tuple3<String, Integer, Long>> salaries = env.addSource(new SalarySource(),
        SOURCE_PARALLELISM);
View Full Code Here

        PARALLELISM).setBufferTimeout(100);

    DataStream<Tuple3<String, Integer, Long>> grades = env.addSource(new GradeSource(),
        SOURCE_PARALLELISM);

    DataStream<Tuple3<String, Integer, Long>> salaries = env.addSource(new SalarySource(),
        SOURCE_PARALLELISM);

    DataStream<Tuple3<String, Integer, Integer>> joinedStream = grades.connect(salaries)
        .flatMap(new WindowJoinTask());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.