Package org.apache.flink.api.java

Examples of org.apache.flink.api.java.ExecutionEnvironment.fromElements()


    DataSet<Tuple2<Integer, String>> left = env.fromElements(
        new Tuple2<Integer, String>(1, "hello"),
        new Tuple2<Integer, String>(2, "what's"),
        new Tuple2<Integer, String>(2, "up")
        );
    DataSet<Tuple2<Integer, String>> right = env.fromElements(
        new Tuple2<Integer, String>(1, "not"),
        new Tuple2<Integer, String>(1, "much"),
        new Tuple2<Integer, String>(2, "really")
        );
    DataSet<Tuple2<Integer,String>> joined = left.join(right).where(0).equalTo(0)
View Full Code Here


  @SuppressWarnings("unchecked")
  @Override
  protected void testProgram() throws Exception {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

    DataSet<Tuple2<Integer, String>> left = env.fromElements(
        new Tuple2<Integer, String>(1, "hello"),
        new Tuple2<Integer, String>(2, "what's"),
        new Tuple2<Integer, String>(2, "up")
        );
    DataSet<Tuple2<Integer, String>> right = env.fromElements(
View Full Code Here

    DataSet<Tuple2<Integer, String>> left = env.fromElements(
        new Tuple2<Integer, String>(1, "hello"),
        new Tuple2<Integer, String>(2, "what's"),
        new Tuple2<Integer, String>(2, "up")
        );
    DataSet<Tuple2<Integer, String>> right = env.fromElements(
        new Tuple2<Integer, String>(1, "not"),
        new Tuple2<Integer, String>(1, "much"),
        new Tuple2<Integer, String>(2, "really")
        );
    DataSet<Integer> joined = left.coGroup(right).where(0).equalTo(0)
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  protected void testProgram() throws Exception {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

    DataSet<Tuple2<Integer, String>> left = env.fromElements(
        new Tuple2<Integer, String>(1, "hello"),
        new Tuple2<Integer, String>(2, "what's"),
        new Tuple2<Integer, String>(2, "up")
        );
    DataSet<Tuple2<Integer, String>> right = env.fromElements(
View Full Code Here

    DataSet<Tuple2<Integer, String>> left = env.fromElements(
        new Tuple2<Integer, String>(1, "hello"),
        new Tuple2<Integer, String>(2, "what's"),
        new Tuple2<Integer, String>(2, "up")
        );
    DataSet<Tuple2<Integer, String>> right = env.fromElements(
        new Tuple2<Integer, String>(1, "not"),
        new Tuple2<Integer, String>(1, "much"),
        new Tuple2<Integer, String>(2, "really")
        );
    DataSet<Tuple2<Integer,String>> joined = left.join(right).where(0).equalTo(0)
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  protected void testProgram() throws Exception {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

    DataSet<Tuple2<Integer,String>> stringDs = env.fromElements(
        new Tuple2<Integer,String>(1, "aa"),
        new Tuple2<Integer,String>(2, "ab"),
        new Tuple2<Integer,String>(1, "ac"),
        new Tuple2<Integer,String>(2, "ad")
        );
View Full Code Here

    // set up the execution environment
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

    // get input data
    DataSet<String> text = env.fromElements(
        "To be, or not to be,--that is the question:--",
        "Whether 'tis nobler in the mind to suffer",
        "The slings and arrows of outrageous fortune",
        "Or to take arms against a sea of troubles,"
        );
View Full Code Here

  @Test
  public void testCombinable() {
    try {
      ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
     
      DataSet<String> input = env.fromElements("1", "2", "1", "3");
     
     
      DistinctOperator<String> op = input.distinct(new KeySelector<String, String>() {
        public String getKey(String value) { return value; }
      });
View Full Code Here

      // ------------ construct the test program ------------------
      {
        env.setDegreeOfParallelism(DEFAULT_DOP);
       
        @SuppressWarnings("unchecked")
        DataSet<Tuple3<Double, Long, String>> initialSolutionSet = env.fromElements(new Tuple3<Double, Long, String>(3.44, 5L, "abc"));
 
        @SuppressWarnings("unchecked")
        DataSet<Tuple2<Double, String>> initialWorkSet = env.fromElements(new Tuple2<Double, String>(1.23, "abc"));
       
        DeltaIteration<Tuple3<Double, Long, String>, Tuple2<Double, String>> iteration = initialSolutionSet.iterateDelta(initialWorkSet, NUM_ITERATIONS, ITERATION_KEYS);
View Full Code Here

       
        @SuppressWarnings("unchecked")
        DataSet<Tuple3<Double, Long, String>> initialSolutionSet = env.fromElements(new Tuple3<Double, Long, String>(3.44, 5L, "abc"));
 
        @SuppressWarnings("unchecked")
        DataSet<Tuple2<Double, String>> initialWorkSet = env.fromElements(new Tuple2<Double, String>(1.23, "abc"));
       
        DeltaIteration<Tuple3<Double, Long, String>, Tuple2<Double, String>> iteration = initialSolutionSet.iterateDelta(initialWorkSet, NUM_ITERATIONS, ITERATION_KEYS);
        iteration.name(ITERATION_NAME).parallelism(ITERATION_DOP);
       
        iteration.registerAggregator(AGGREGATOR_NAME, new LongSumAggregator());
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.