Package org.apache.flink.api.java

Examples of org.apache.flink.api.java.CollectionEnvironment.execute()


     
      env.fromElements(TEST_DATA)
          .map(new SuffixAppender()).withBroadcastSet(bcData, BC_VAR_NAME)
          .output(new LocalCollectionOutputFormat<String>(result));
     
      env.execute();
     
      assertEquals(TEST_DATA.length, result.size());
      for (String s : result) {
        assertTrue(s.indexOf(SUFFIX) > 0);
      }
View Full Code Here


      List<String> result = new ArrayList<String>();
     
      inData.cross(inData).with(new SuffixCross()).withBroadcastSet(bcData, BC_VAR_NAME)
          .output(new LocalCollectionOutputFormat<String>(result));
     
      env.execute();
     
      assertEquals(TEST_DATA.length * TEST_DATA.length, result.size());
      for (String s : result) {
        assertTrue(s.indexOf(SUFFIX) == 2);
      }
View Full Code Here

     
      env.generateSequence(1, NUM_ELEMENTS)
        .map(new CountingMapper())
        .output(new DiscardingOuputFormat<Long>());
     
      JobExecutionResult result = env.execute();
     
      assertTrue(result.getNetRuntime() >= 0);
     
      assertEquals(NUM_ELEMENTS, result.getAccumulatorResult(ACCUMULATOR_NAME));
    }
View Full Code Here

      DataSet<Integer> result = iteration.closeWith(iteration.map(new AddSuperstepNumberMapper()));
     
      List<Integer> collected = new ArrayList<Integer>();
      result.output(new LocalCollectionOutputFormat<Integer>(collected));
     
      env.execute();
     
      assertEquals(1, collected.size());
      assertEquals(56, collected.get(0).intValue());
    }
    catch (Exception e) {
View Full Code Here

      List<Integer> collected = new ArrayList<Integer>();
     
      iteration.closeWith(iterationResult, terminationCriterion)
          .output(new LocalCollectionOutputFormat<Integer>(collected));
     
      env.execute();
     
      assertEquals(1, collected.size());
      assertEquals(56, collected.get(0).intValue());
    }
    catch (Exception e) {
View Full Code Here

      List<Tuple2<Integer, Integer>> collected = new ArrayList<Tuple2<Integer, Integer>>();

      iteration.closeWith(solDelta, nextWorkset)
          .output(new LocalCollectionOutputFormat<Tuple2<Integer, Integer>>(collected));

      env.execute();

      // verify that both tuple fields are now the same
      for (Tuple2<Integer, Integer> t: collected) {
        assertEquals(t.f0, t.f1);
      }
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.