Package org.apache.flink.compiler.plan

Examples of org.apache.flink.compiler.plan.SourcePlanNode


  }
 
  @Test
  public void testTwoOperatorsBothDependent() {
    try {
      SourcePlanNode target = new SourcePlanNode(getSourceNode(), "Partial Solution");
     
      Channel toMap1 = new Channel(target);
      toMap1.setShipStrategy(ShipStrategyType.FORWARD);
      toMap1.setLocalStrategy(LocalStrategy.NONE);
      SingleInputPlanNode map1 = new SingleInputPlanNode(getMapNode(), "Mapper 1", toMap1, DriverStrategy.MAP);
View Full Code Here


      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
     
      // the all-reduce has no combiner, when the DOP of the input is one
     
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // check wiring
      assertEquals(sourceNode, reduceNode.getInput().getSource());
      assertEquals(reduceNode, sinkNode.getInput().getSource());
     
      // check that reduce has the right strategy
      assertEquals(DriverStrategy.ALL_GROUP_REDUCE, reduceNode.getDriverStrategy());
     
      // check DOP
      assertEquals(1, sourceNode.getDegreeOfParallelism());
      assertEquals(1, reduceNode.getDegreeOfParallelism());
      assertEquals(1, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
View Full Code Here

      OptimizedPlan op = compileNoStats(p);
     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // get the combiner
      SingleInputPlanNode combineNode = (SingleInputPlanNode) reduceNode.getInput().getSource();
     
      // check wiring
      assertEquals(sourceNode, combineNode.getInput().getSource());
      assertEquals(reduceNode, sinkNode.getInput().getSource());
     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.ALL_GROUP_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.ALL_GROUP_COMBINE, combineNode.getDriverStrategy());
     
      // check DOP
      assertEquals(8, sourceNode.getDegreeOfParallelism());
      assertEquals(8, combineNode.getDegreeOfParallelism());
      assertEquals(1, reduceNode.getDegreeOfParallelism());
      assertEquals(1, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
View Full Code Here

      OptimizedPlan op = compileNoStats(p);
     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // check wiring
      assertEquals(sourceNode, reduceNode.getInput().getSource());
      assertEquals(reduceNode, sinkNode.getInput().getSource());
     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reduceNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(1), reduceNode.getKeys(0));
      assertEquals(new FieldList(1), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(8, reduceNode.getDegreeOfParallelism());
      assertEquals(8, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
View Full Code Here

      OptimizedPlan op = compileNoStats(p);
     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // get the combiner
      SingleInputPlanNode combineNode = (SingleInputPlanNode) reduceNode.getInput().getSource();
     
      // check wiring
      assertEquals(sourceNode, combineNode.getInput().getSource());
      assertEquals(reduceNode, sinkNode.getInput().getSource());
     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.SORTED_GROUP_COMBINE, combineNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(1), reduceNode.getKeys(0));
      assertEquals(new FieldList(1), combineNode.getKeys(0));
      assertEquals(new FieldList(1), combineNode.getKeys(1));
      assertEquals(new FieldList(1), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(6, combineNode.getDegreeOfParallelism());
      assertEquals(8, reduceNode.getDegreeOfParallelism());
      assertEquals(8, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
View Full Code Here

      OptimizedPlan op = compileNoStats(p);
     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // get the key extractors and projectors
      SingleInputPlanNode keyExtractor = (SingleInputPlanNode) reduceNode.getInput().getSource();
      SingleInputPlanNode keyProjector = (SingleInputPlanNode) sinkNode.getInput().getSource();
     
      // check wiring
      assertEquals(sourceNode, keyExtractor.getInput().getSource());
      assertEquals(keyProjector, sinkNode.getInput().getSource());
     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reduceNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(0), reduceNode.getKeys(0));
      assertEquals(new FieldList(0), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(6, keyExtractor.getDegreeOfParallelism());
     
      assertEquals(8, reduceNode.getDegreeOfParallelism());
      assertEquals(8, keyProjector.getDegreeOfParallelism());
      assertEquals(8, sinkNode.getDegreeOfParallelism());
View Full Code Here

      OptimizedPlan op = compileNoStats(p);
     
      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
      // get the original nodes
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // get the combiner
      SingleInputPlanNode combineNode = (SingleInputPlanNode) reduceNode.getInput().getSource();
     
      // get the key extractors and projectors
      SingleInputPlanNode keyExtractor = (SingleInputPlanNode) combineNode.getInput().getSource();
      SingleInputPlanNode keyProjector = (SingleInputPlanNode) sinkNode.getInput().getSource();
     
      // check wiring
      assertEquals(sourceNode, keyExtractor.getInput().getSource());
      assertEquals(keyProjector, sinkNode.getInput().getSource());
     
      // check that both reduce and combiner have the same strategy
      assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reduceNode.getDriverStrategy());
      assertEquals(DriverStrategy.SORTED_GROUP_COMBINE, combineNode.getDriverStrategy());
     
      // check the keys
      assertEquals(new FieldList(0), reduceNode.getKeys(0));
      assertEquals(new FieldList(0), combineNode.getKeys(0));
      assertEquals(new FieldList(0), combineNode.getKeys(1));
      assertEquals(new FieldList(0), reduceNode.getInput().getLocalStrategyKeys());
     
      // check DOP
      assertEquals(6, sourceNode.getDegreeOfParallelism());
      assertEquals(6, keyExtractor.getDegreeOfParallelism());
      assertEquals(6, combineNode.getDegreeOfParallelism());
     
      assertEquals(8, reduceNode.getDegreeOfParallelism());
      assertEquals(8, keyProjector.getDegreeOfParallelism());
View Full Code Here

  public void testGetEstimatesNoReplicationFactor() {
    final long NUM_RECORD = 1001;
    final long SIZE = 467131;
   
    DataSourceNode source = getSourceNode();
    SourcePlanNode planNode = new SourcePlanNode(source, "test node");
    Channel channel = new Channel(planNode);

    // no estimates here
    Assert.assertEquals(-1, channel.getEstimatedOutputSize());
    Assert.assertEquals(-1, channel.getEstimatedNumRecords());
View Full Code Here

    final long SIZE = 467131;
   
    final int REPLICATION = 23;
   
    DataSourceNode source = getSourceNode();
    SourcePlanNode planNode = new SourcePlanNode(source, "test node");
    Channel channel = new Channel(planNode);
    channel.setReplicationFactor(REPLICATION);

    // no estimates here
    Assert.assertEquals(-1, channel.getEstimatedOutputSize());
View Full Code Here

      OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(op);
     
     
      // the all-reduce has no combiner, when the DOP of the input is one
     
      SourcePlanNode sourceNode = resolver.getNode("source");
      SingleInputPlanNode reduceNode = resolver.getNode("reducer");
      SinkPlanNode sinkNode = resolver.getNode("sink");
     
      // check wiring
      assertEquals(sourceNode, reduceNode.getInput().getSource());
      assertEquals(reduceNode, sinkNode.getInput().getSource());
     
      // check DOP
      assertEquals(1, sourceNode.getDegreeOfParallelism());
      assertEquals(1, reduceNode.getDegreeOfParallelism());
      assertEquals(1, sinkNode.getDegreeOfParallelism());
    }
    catch (Exception e) {
      System.err.println(e.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.flink.compiler.plan.SourcePlanNode

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.