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

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


  @SuppressWarnings("unchecked")
  @Test
  public void testBranchEachContractType() {
    try {
      // construct the plan
      FileDataSource sourceA = new FileDataSource(new DummyInputFormat(), "file:///test/file1", "Source A");
      FileDataSource sourceB = new FileDataSource(new DummyInputFormat(), "file:///test/file2", "Source B");
      FileDataSource sourceC = new FileDataSource(new DummyInputFormat(), "file:///test/file3", "Source C");
     
      MapOperator map1 = MapOperator.builder(new IdentityMap()).input(sourceA).name("Map 1").build();
     
      ReduceOperator reduce1 = ReduceOperator.builder(new IdentityReduce(), IntValue.class, 0)
        .input(map1)
View Full Code Here


  @Test
  public void testBranchingUnion() {
    try {
      // construct the plan
      FileDataSource source1 = new FileDataSource(new DummyInputFormat(), IN_FILE);
      FileDataSource source2 = new FileDataSource(new DummyInputFormat(), IN_FILE);
     
      JoinOperator mat1 = JoinOperator.builder(new DummyMatchStub(), IntValue.class, 0, 0)
        .input1(source1)
        .input2(source2)
        .name("Match 1")
View Full Code Here

    try {
      // construct the plan
      final String out1Path = "file:///test/1";
      final String out2Path = "file:///test/2";
 
      FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE);
     
      FileDataSink sinkA = new FileDataSink(DummyOutputFormat.class, out1Path, sourceA);
      FileDataSink sinkB = new FileDataSink(DummyOutputFormat.class, out2Path, sourceA);
     
      List<FileDataSink> sinks = new ArrayList<FileDataSink>();
View Full Code Here

  public void testSimpleDisjointPlan() {
    // construct the plan
    final String out1Path = "file:///test/1";
    final String out2Path = "file:///test/2";

    FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE);
    FileDataSource sourceB = new FileDataSource(DummyInputFormat.class, IN_FILE);
   
    FileDataSink sinkA = new FileDataSink(DummyOutputFormat.class, out1Path, sourceA);
    FileDataSink sinkB = new FileDataSink(DummyOutputFormat.class, out2Path, sourceB);
   
    List<FileDataSink> sinks = new ArrayList<FileDataSink>();
View Full Code Here

    final String out1Path = "file:///test/1";
    final String out2Path = "file:///test/2";
    final String out3Path = "file:///test/3";
    final String out4Path = "file:///test/4";

    FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE);
    FileDataSource sourceB = new FileDataSource(DummyInputFormat.class, IN_FILE);
   
    FileDataSink sink1 = new FileDataSink(DummyOutputFormat.class, out1Path, sourceA, "1");
    FileDataSink sink2 = new FileDataSink(DummyOutputFormat.class, out2Path, sourceB, "2");
    FileDataSink sink3 = new FileDataSink(DummyOutputFormat.class, out3Path, sourceA, "3");
    FileDataSink sink4 = new FileDataSink(DummyOutputFormat.class, out4Path, sourceB, "4");
View Full Code Here

    }
  }
 
  @Test
  public void testBranchAfterIteration() {
    FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE, "Source 2");
   
    BulkIteration iteration = new BulkIteration("Loop");
    iteration.setInput(sourceA);
    iteration.setMaximumNumberOfIterations(10);
   
View Full Code Here

    }
  }
 
  @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);
   
View Full Code Here

   *         (SINK 3)     (CROSS => NEXT PARTIAL SOLUTION)
   * </pre>
   */
  @Test
  public void testClosure() {
    FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE, "Source 1");
    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");
View Full Code Here

   *                (JOIN => SOLUTION SET DELTA)
   * </pre>
   */
  @Test
  public void testClosureDeltaIteration() {
    FileDataSource sourceA = new FileDataSource(DummyInputFormat.class, IN_FILE, "Source 1");
    FileDataSource sourceB = new FileDataSource(DummyInputFormat.class, IN_FILE, "Source 2");
    FileDataSource sourceC = new FileDataSource(DummyInputFormat.class, IN_FILE, "Source 3");

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

    DeltaIteration iteration = new DeltaIteration(0, "Loop");
View Full Code Here

   * <p/>
   * </prev>
   */
  @Test
  public void testDeltaIterationWithStaticInput() {
    FileDataSource source = new FileDataSource(DummyInputFormat.class, IN_FILE, "source");

    MapOperator mappedSource = MapOperator.builder(IdentityMap.class).
        input(source).
        name("Identity mapped source").
        build();
View Full Code Here

TOP

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

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.