Package org.apache.flink.api.java.record.operators

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


  @Test
  public void testBranchBeforeIteration() {
    FileDataSource source1 = new FileDataSource(DummyInputFormat.class, IN_FILE, "Source 1");
    FileDataSource source2 = new FileDataSource(DummyInputFormat.class, IN_FILE, "Source 2");
   
    BulkIteration iteration = new BulkIteration("Loop");
    iteration.setInput(source2);
    iteration.setMaximumNumberOfIterations(10);
   
    MapOperator inMap = MapOperator.builder(new IdentityMap())
                               .input(source1)
                               .name("In Iteration Map")
                               .setBroadcastVariable("BC", iteration.getPartialSolution())
                               .build();
   
    iteration.setNextPartialSolution(inMap);
   
    MapOperator postMap = MapOperator.builder(new IdentityMap())
                     .input(source1)
                     .name("Post Iteration Map")
                     .setBroadcastVariable("BC", iteration)
View Full Code Here


    FileDataSource sourceB = new FileDataSource(DummyInputFormat.class, IN_FILE, "Source 2");

    FileDataSink sink1 = new FileDataSink(DummyOutputFormat.class, OUT_FILE, sourceA, "Sink 1");
    FileDataSink sink2 = new FileDataSink(DummyOutputFormat.class, OUT_FILE, sourceB, "Sink 2");

    BulkIteration iteration = new BulkIteration("Loop");
    iteration.setInput(sourceA);
    iteration.setMaximumNumberOfIterations(10);

    CrossOperator stepFunction = CrossOperator.builder(DummyCrossStub.class).name("StepFunction").
        input1(iteration.getPartialSolution()).
        input2(sourceB).
        build();

    iteration.setNextPartialSolution(stepFunction);

    FileDataSink sink3 = new FileDataSink(DummyOutputFormat.class, OUT_FILE, iteration, "Sink 3");

    List<FileDataSink> sinks = new ArrayList<FileDataSink>();
    sinks.add(sink1);
View Full Code Here

    ReduceOperator reducedSource = ReduceOperator.builder(IdentityReduce.class).
        input(source).
        name("Identity reduce source").
        build();

    BulkIteration iteration = new BulkIteration("Loop");
    iteration.setInput(mappedSource);
    iteration.setMaximumNumberOfIterations(10);

    JoinOperator nextPartialSolution = JoinOperator.builder(DummyMatchStub.class, IntValue.class, 0,0).
        input1(iteration.getPartialSolution()).
        input2(reducedSource).
        name("Next partial solution").
        build();

    iteration.setNextPartialSolution(nextPartialSolution);

    FileDataSink sink = new FileDataSink(DummyOutputFormat.class, OUT_FILE, iteration, "Iteration sink");
    List<FileDataSink> sinks = new ArrayList<FileDataSink>();
    sinks.add(sink);
View Full Code Here

TOP

Related Classes of org.apache.flink.api.java.record.operators.BulkIteration

Copyright © 2018 www.massapicom. 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.