Package org.apache.flink.compiler.plan

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


  public List<PlanNode> getAlternativePlans(CostEstimator estimator) {
    if (this.cachedPlans != null) {
      return this.cachedPlans;
    }
   
    SourcePlanNode candidate = new SourcePlanNode(this, "DataSource ("+this.getPactContract().getName()+")");
    candidate.updatePropertiesWithUniqueSets(getUniqueFields());
   
    final Costs costs = new Costs();
    if (FileInputFormat.class.isAssignableFrom(getPactContract().getFormatWrapper().getUserCodeClass()) &&
        this.estimatedOutputSize >= 0)
    {
      estimator.addFileInputCost(this.estimatedOutputSize, costs);
    }
    candidate.setCosts(costs);

    // since there is only a single plan for the data-source, return a list with that element only
    List<PlanNode> plans = new ArrayList<PlanNode>(1);
    plans.add(candidate);
View Full Code Here


      PlanJSONDumpGenerator dumper = new PlanJSONDumpGenerator();
      String json = dumper.getOptimizerPlanAsJSON(optPlan);
      System.out.println(json);
    }
   
    SourcePlanNode vertexSource = or.getNode(VERTEX_SOURCE);
    SourcePlanNode edgesSource = or.getNode(EDGES_SOURCE);
    SinkPlanNode sink = or.getNode(SINK);
    WorksetIterationPlanNode iter = or.getNode(ITERATION_NAME);
   
    DualInputPlanNode neighborsJoin = or.getNode(JOIN_NEIGHBORS_MATCH);
    SingleInputPlanNode minIdReducer = or.getNode(MIN_ID_REDUCER);
    SingleInputPlanNode minIdCombiner = (SingleInputPlanNode) minIdReducer.getPredecessor();
    DualInputPlanNode updatingMatch = or.getNode(UPDATE_ID_MATCH);
   
    // test all drivers
    Assert.assertEquals(DriverStrategy.NONE, sink.getDriverStrategy());
    Assert.assertEquals(DriverStrategy.NONE, vertexSource.getDriverStrategy());
    Assert.assertEquals(DriverStrategy.NONE, edgesSource.getDriverStrategy());
   
    Assert.assertEquals(DriverStrategy.HYBRIDHASH_BUILD_SECOND_CACHED, neighborsJoin.getDriverStrategy());
    Assert.assertTrue(!neighborsJoin.getInput1().getTempMode().isCached());
    Assert.assertTrue(!neighborsJoin.getInput2().getTempMode().isCached());
    Assert.assertEquals(set0, neighborsJoin.getKeysForInput1());
View Full Code Here

      PlanJSONDumpGenerator dumper = new PlanJSONDumpGenerator();
      String json = dumper.getOptimizerPlanAsJSON(optPlan);
      System.out.println(json);
    }
   
    SourcePlanNode vertexSource = or.getNode(VERTEX_SOURCE);
    SourcePlanNode edgesSource = or.getNode(EDGES_SOURCE);
    SinkPlanNode sink = or.getNode(SINK);
    WorksetIterationPlanNode iter = or.getNode(ITERATION_NAME);
   
    DualInputPlanNode neighborsJoin = or.getNode(JOIN_NEIGHBORS_MATCH);
    SingleInputPlanNode minIdReducer = or.getNode(MIN_ID_REDUCER);
    SingleInputPlanNode minIdCombiner = (SingleInputPlanNode) minIdReducer.getPredecessor();
    DualInputPlanNode updatingMatch = or.getNode(UPDATE_ID_MATCH);
   
    // test all drivers
    Assert.assertEquals(DriverStrategy.NONE, sink.getDriverStrategy());
    Assert.assertEquals(DriverStrategy.NONE, vertexSource.getDriverStrategy());
    Assert.assertEquals(DriverStrategy.NONE, edgesSource.getDriverStrategy());
   
    Assert.assertEquals(DriverStrategy.HYBRIDHASH_BUILD_SECOND_CACHED, neighborsJoin.getDriverStrategy());
    Assert.assertTrue(!neighborsJoin.getInput1().getTempMode().isCached());
    Assert.assertTrue(!neighborsJoin.getInput2().getTempMode().isCached());
    Assert.assertEquals(set0, neighborsJoin.getKeysForInput1());
View Full Code Here

      PlanJSONDumpGenerator dumper = new PlanJSONDumpGenerator();
      String json = dumper.getOptimizerPlanAsJSON(optPlan);
      System.out.println(json);
    }
   
    SourcePlanNode vertexSource = or.getNode(VERTEX_SOURCE);
    SourcePlanNode edgesSource = or.getNode(EDGES_SOURCE);
    SinkPlanNode sink = or.getNode(SINK);
    WorksetIterationPlanNode iter = or.getNode(ITERATION_NAME);
   
    DualInputPlanNode neighborsJoin = or.getNode(JOIN_NEIGHBORS_MATCH);
    DualInputPlanNode cogroup = or.getNode(MIN_ID_AND_UPDATE);
   
    // --------------------------------------------------------------------
    // Plan validation:
    //
    // We expect the plan to go with a sort-merge join, because the CoGroup
    // sorts and the join in the successive iteration can re-exploit the sorting.
    // --------------------------------------------------------------------
   
    // test all drivers
    Assert.assertEquals(DriverStrategy.NONE, sink.getDriverStrategy());
    Assert.assertEquals(DriverStrategy.NONE, vertexSource.getDriverStrategy());
    Assert.assertEquals(DriverStrategy.NONE, edgesSource.getDriverStrategy());
   
    Assert.assertEquals(DriverStrategy.MERGE, neighborsJoin.getDriverStrategy());
    Assert.assertEquals(set0, neighborsJoin.getKeysForInput1());
    Assert.assertEquals(set0, neighborsJoin.getKeysForInput2());
   
View Full Code Here

public class FeedbackPropertiesMatchTest {

  @Test
  public void testNoPartialSolutionFoundSingleInputOnly() {
    try {
      SourcePlanNode target = new SourcePlanNode(getSourceNode(), "Source");
     
      SourcePlanNode otherTarget = new SourcePlanNode(getSourceNode(), "Source");
     
      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

  }
 
  @Test
  public void testSingleInputOperators() {
    try {
      SourcePlanNode target = new SourcePlanNode(getSourceNode(), "Source");
     
      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

  }
 
  @Test
  public void testSingleInputOperatorsWithReCreation() {
    try {
      SourcePlanNode target = new SourcePlanNode(getSourceNode(), "Source");
     
      Channel toMap1 = new Channel(target);
      SingleInputPlanNode map1 = new SingleInputPlanNode(getMapNode(), "Mapper 1", toMap1, DriverStrategy.MAP);
     
      Channel toMap2 = new Channel(map1);
View Full Code Here

  }
 
  @Test
  public void testSingleInputOperatorsChainOfThree() {
    try {
      SourcePlanNode target = new SourcePlanNode(getSourceNode(), "Source");
     
      Channel toMap1 = new Channel(target);
      SingleInputPlanNode map1 = new SingleInputPlanNode(getMapNode(), "Mapper 1", toMap1, DriverStrategy.MAP);
     
      Channel toMap2 = new Channel(map1);
View Full Code Here

  }
 
  @Test
  public void testNoPartialSolutionFoundTwoInputOperator() {
    try {
      SourcePlanNode target = new SourcePlanNode(getSourceNode(), "Partial Solution");

      SourcePlanNode source1 = new SourcePlanNode(getSourceNode(), "Source 1");
      SourcePlanNode source2 = new SourcePlanNode(getSourceNode(), "Source 2");
     
      Channel toMap1 = new Channel(source1);
      toMap1.setShipStrategy(ShipStrategyType.FORWARD);
      toMap1.setLocalStrategy(LocalStrategy.NONE);
      SingleInputPlanNode map1 = new SingleInputPlanNode(getMapNode(), "Mapper 1", toMap1, DriverStrategy.MAP);
View Full Code Here

  }
 
  @Test
  public void testTwoOperatorsOneIndependent() {
    try {
      SourcePlanNode target = new SourcePlanNode(getSourceNode(), "Partial Solution");
      SourcePlanNode source = new SourcePlanNode(getSourceNode(), "Other Source");
     
      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

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.