Examples of ReduceOperator


Examples of org.apache.flink.api.java.record.operators.ReduceOperator

  @Test
  public void testReduce() {
    // construct the plan
    FileDataSource source = new FileDataSource(new DummyInputFormat(), IN_FILE, "Source");
    ReduceOperator reduce1 = ReduceOperator.builder(new IdentityReduce()).name("Reduce1").input(source).build();
    FileDataSink sink = new FileDataSink(new DummyOutputFormat(), OUT_FILE, "Sink");
    sink.setInput(reduce1);
    Plan plan = new Plan(sink, "AllReduce Test");
    plan.setDefaultParallelism(DEFAULT_PARALLELISM);
   
View Full Code Here

Examples of org.apache.flink.api.java.record.operators.ReduceOperator

  @Test
  public void testWrappedReduceObject() {
    try {
      AtomicInteger methodCounter = new AtomicInteger();
     
      ReduceOperator reduceOp = ReduceOperator.builder(new TestReduceFunction(methodCounter)).build();
     
      RichFunction reducer = (RichFunction) reduceOp.getUserCodeWrapper().getUserCodeObject();
     
      // test the method invocations
      reducer.close();
      reducer.open(new Configuration());
      assertEquals(2, methodCounter.get());
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.