Package org.apache.flink.compiler.plan

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


        for (Iterator<PlanNode> iter = list.iterator(); iter.hasNext();) {
          PlanNode in = iter.next();
          if (in.getOriginalOptimizerNode().getPactContract() == c) {
            // is this the child or is our node the child
            if (in instanceof SingleInputPlanNode && n instanceof SingleInputPlanNode) {
              SingleInputPlanNode thisNode = (SingleInputPlanNode) n;
              SingleInputPlanNode otherNode = (SingleInputPlanNode) in;
             
              if (thisNode.getPredecessor() == otherNode) {
                // other node is child, remove it
                iter.remove();
              } else if (otherNode.getPredecessor() == thisNode) {
                shouldAdd = false;
              }
            } else {
              throw new RuntimeException("Unrecodnized case in test.");
            }
View Full Code Here


  public SingleInputPlanNode instantiate(Channel in, SingleInputNode node) {
    // create in input node for combine with same DOP as input node
    GroupReduceNode combinerNode = new GroupReduceNode((GroupReduceOperatorBase<?, ?, ?>) node.getPactContract());
    combinerNode.setDegreeOfParallelism(in.getSource().getDegreeOfParallelism());

    SingleInputPlanNode combiner = new SingleInputPlanNode(combinerNode, "Combine("+node.getPactContract().getName()+")", in,
        DriverStrategy.SORTED_GROUP_COMBINE);
    // sorting key info
    combiner.setDriverKeyInfo(in.getLocalStrategyKeys(), in.getLocalStrategySortOrder(), 0);
    // set grouping comparator key info
    combiner.setDriverKeyInfo(this.keyList, 1);
   
    return combiner;
  }
View Full Code Here

    return DriverStrategy.COLLECTOR_MAP;
  }

  @Override
  public SingleInputPlanNode instantiate(Channel in, SingleInputNode node) {
    return new SingleInputPlanNode(node, "Map ("+node.getPactContract().getName()+")", in, DriverStrategy.COLLECTOR_MAP);
  }
View Full Code Here

    return DriverStrategy.UNARY_NO_OP;
  }

  @Override
  public SingleInputPlanNode instantiate(Channel in, SingleInputNode node) {
    return new SingleInputPlanNode(node, "Pipe", in, DriverStrategy.UNARY_NO_OP);
  }
View Full Code Here

        if (!in.getLocalStrategyKeys().isValidUnorderedPrefix(this.keys)) {
          throw new RuntimeException("Bug: Inconsistent sort for group strategy.");
        }
        in.setLocalStrategy(LocalStrategy.COMBININGSORT, in.getLocalStrategyKeys(), in.getLocalStrategySortOrder());
      }
      return new SingleInputPlanNode(node, "Reduce("+node.getPactContract().getName()+")", in, DriverStrategy.SORTED_GROUP_REDUCE, this.keyList);
    } else {
      // non forward case. all local properties are killed anyways, so we can safely plug in a combiner
      Channel toCombiner = new Channel(in.getSource());
      toCombiner.setShipStrategy(ShipStrategyType.FORWARD);
      // create an input node for combine with same DOP as input node
      GroupReduceNode combinerNode = ((GroupReduceNode) node).getCombinerUtilityNode();
      combinerNode.setDegreeOfParallelism(in.getSource().getDegreeOfParallelism());

      SingleInputPlanNode combiner = new SingleInputPlanNode(combinerNode, "Combine("+node.getPactContract()
          .getName()+")", toCombiner, DriverStrategy.SORTED_GROUP_COMBINE);
      combiner.setCosts(new Costs(0, 0));
      combiner.initProperties(toCombiner.getGlobalProperties(), toCombiner.getLocalProperties());
      // set sorting comparator key info
      combiner.setDriverKeyInfo(in.getLocalStrategyKeys(), in.getLocalStrategySortOrder(), 0);
      // set grouping comparator key info
      combiner.setDriverKeyInfo(this.keyList, 1);
     
      Channel toReducer = new Channel(combiner);
      toReducer.setShipStrategy(in.getShipStrategy(), in.getShipStrategyKeys(), in.getShipStrategySortOrder());
      toReducer.setLocalStrategy(LocalStrategy.COMBININGSORT, in.getLocalStrategyKeys(), in.getLocalStrategySortOrder());
      return new SingleInputPlanNode(node, "Reduce ("+node.getPactContract().getName()+")", toReducer, DriverStrategy.SORTED_GROUP_REDUCE, this.keyList);
    }
  }
View Full Code Here

    return DriverStrategy.UNARY_NO_OP;
  }

  @Override
  public SingleInputPlanNode instantiate(Channel in, SingleInputNode node) {
    return new SingleInputPlanNode(node, "SolutionSet Delta", in, DriverStrategy.UNARY_NO_OP);
  }
View Full Code Here

  @Override
  public SingleInputPlanNode instantiate(Channel in, SingleInputNode node) {
    if (in.getShipStrategy() == ShipStrategyType.FORWARD) {
      // locally connected, directly instantiate
      return new SingleInputPlanNode(node, "Reduce ("+node.getPactContract().getName()+")", in, DriverStrategy.ALL_REDUCE);
    } else {
      // non forward case.plug in a combiner
      Channel toCombiner = new Channel(in.getSource());
      toCombiner.setShipStrategy(ShipStrategyType.FORWARD);
     
      // create an input node for combine with same DOP as input node
      ReduceNode combinerNode = ((ReduceNode) node).getCombinerUtilityNode();
      combinerNode.setDegreeOfParallelism(in.getSource().getDegreeOfParallelism());

      SingleInputPlanNode combiner = new SingleInputPlanNode(combinerNode, "Combine ("+node.getPactContract().getName()+")", toCombiner, DriverStrategy.ALL_REDUCE);
      combiner.setCosts(new Costs(0, 0));
      combiner.initProperties(toCombiner.getGlobalProperties(), toCombiner.getLocalProperties());
     
      Channel toReducer = new Channel(combiner);
      toReducer.setShipStrategy(in.getShipStrategy(), in.getShipStrategyKeys(), in.getShipStrategySortOrder());
      toReducer.setLocalStrategy(in.getLocalStrategy(), in.getLocalStrategyKeys(), in.getLocalStrategySortOrder());
      return new SingleInputPlanNode(node, "Reduce("+node.getPactContract().getName()+")", toReducer, DriverStrategy.ALL_REDUCE);
    }
  }
View Full Code Here

          locPropsReq.parameterizeChannel(toNoOp);
         
          UnaryOperatorNode rebuildPropertiesNode = new UnaryOperatorNode("Rebuild Partial Solution Properties", FieldList.EMPTY_LIST);
          rebuildPropertiesNode.setDegreeOfParallelism(candidate.getDegreeOfParallelism());
         
          SingleInputPlanNode rebuildPropertiesPlanNode = new SingleInputPlanNode(rebuildPropertiesNode, "Rebuild Partial Solution Properties", toNoOp, DriverStrategy.UNARY_NO_OP);
          rebuildPropertiesPlanNode.initProperties(toNoOp.getGlobalProperties(), toNoOp.getLocalProperties());
          estimator.costOperator(rebuildPropertiesPlanNode);
           
          GlobalProperties atEndGlobalModified = rebuildPropertiesPlanNode.getGlobalProperties();
          LocalProperties atEndLocalModified = rebuildPropertiesPlanNode.getLocalProperties();
           
          if (!(atEndGlobalModified.equals(atEndGlobal) && atEndLocalModified.equals(atEndLocal))) {
            FeedbackPropertiesMeetRequirementsReport report2 = candidate.checkPartialSolutionPropertiesMet(pspn, atEndGlobalModified, atEndLocalModified);
           
            if (report2 != FeedbackPropertiesMeetRequirementsReport.NOT_MET) {
View Full Code Here

    return DriverStrategy.SORTED_GROUP_REDUCE;
  }

  @Override
  public SingleInputPlanNode instantiate(Channel in, SingleInputNode node) {
    return new SingleInputPlanNode(node, "Reduce("+node.getPactContract().getName()+")", in, DriverStrategy.SORTED_GROUP_REDUCE, this.keyList);
  }
View Full Code Here

  private void checkPlan(OptimizedPlan plan) {
   
    OptimizerPlanNodeResolver or = getOptimizerPlanNodeResolver(plan);
   
    final SinkPlanNode sink = or.getNode(SINK);
    final SingleInputPlanNode reducer = or.getNode(REDUCER_NAME);
    final SingleInputPlanNode combiner = (SingleInputPlanNode) reducer.getPredecessor();
    final SingleInputPlanNode mapper = or.getNode(MAPPER_NAME);
   
    // check the mapper
    assertEquals(1, mapper.getBroadcastInputs().size());
    assertEquals(ShipStrategyType.FORWARD, mapper.getInput().getShipStrategy());
    assertEquals(ShipStrategyType.BROADCAST, mapper.getBroadcastInputs().get(0).getShipStrategy());
   
    assertEquals(LocalStrategy.NONE, mapper.getInput().getLocalStrategy());
    assertEquals(LocalStrategy.NONE, mapper.getBroadcastInputs().get(0).getLocalStrategy());
   
    assertEquals(DriverStrategy.COLLECTOR_MAP, mapper.getDriverStrategy());
   
    assertNull(mapper.getInput().getLocalStrategyKeys());
    assertNull(mapper.getInput().getLocalStrategySortOrder());
    assertNull(mapper.getBroadcastInputs().get(0).getLocalStrategyKeys());
    assertNull(mapper.getBroadcastInputs().get(0).getLocalStrategySortOrder());
   
   
    // check the combiner
    Assert.assertNotNull(combiner);
    assertEquals(ShipStrategyType.FORWARD, combiner.getInput().getShipStrategy());
View Full Code Here

TOP

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

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.