@Override public SourceAndDamReport hasDamOnPathDownTo(PlanNode source) { if (source == this) { return FOUND_SOURCE_AND_DAM; } SourceAndDamReport res = this.initialInput.getSource().hasDamOnPathDownTo(source); if (res == FOUND_SOURCE_AND_DAM || res == FOUND_SOURCE) { return FOUND_SOURCE_AND_DAM; } else { return NOT_FOUND; } } }
public BinaryUnionPlanNode(BinaryUnionPlanNode toSwapFrom) { super(toSwapFrom.getOptimizerNode(), "Union-With-Cached", toSwapFrom.getInput2(), toSwapFrom.getInput1(), DriverStrategy.UNION_WITH_CACHED); this.globalProps = toSwapFrom.globalProps; this.localProps = toSwapFrom.localProps; this.nodeCosts = toSwapFrom.nodeCosts; this.cumulativeCosts = toSwapFrom.cumulativeCosts; setParallelism(toSwapFrom.getParallelism()); }
private void checkStandardStrategies(SingleInputPlanNode map, DualInputPlanNode join, SingleInputPlanNode combiner, SingleInputPlanNode reducer, SinkPlanNode sink) { // check ship strategies that are always fix Assert.assertEquals(ShipStrategyType.FORWARD, map.getInput().getShipStrategy()); Assert.assertEquals(ShipStrategyType.FORWARD, sink.getInput().getShipStrategy()); // check the driver strategies that are always fix Assert.assertEquals(DriverStrategy.FLAT_MAP, map.getDriverStrategy()); Assert.assertEquals(DriverStrategy.SORTED_GROUP_REDUCE, reducer.getDriverStrategy()); Assert.assertEquals(DriverStrategy.NONE, sink.getDriverStrategy()); if (combiner != null) { Assert.assertEquals(DriverStrategy.SORTED_GROUP_COMBINE, combiner.getDriverStrategy()); Assert.assertEquals(LocalStrategy.NONE, combiner.getInput().getLocalStrategy()); } }
private boolean checkRepartitionShipStrategies(DualInputPlanNode join, SingleInputPlanNode reducer, SingleInputPlanNode combiner) { if (ShipStrategyType.PARTITION_HASH == join.getInput1().getShipStrategy() && ShipStrategyType.PARTITION_HASH == join.getInput2().getShipStrategy() && ShipStrategyType.FORWARD == reducer.getInput().getShipStrategy()) { // check combiner Assert.assertNull("Plan should not have a combiner", combiner); return true; } else { return false; } }
public void setCosts(Costs nodeCosts) { // the plan enumeration logic works as for regular two-input-operators, which is important // because of the branch handling logic. it does pick redistributing network channels // between the sink and the sink joiner, because sinks joiner has a different parallelism than the sink. // we discard any cost and simply use the sum of the costs from the two children. Costs totalCosts = getInput1().getSource().getCumulativeCosts().clone(); totalCosts.addCosts(getInput2().getSource().getCumulativeCosts()); super.setCosts(totalCosts); }
@Override public boolean preVisit(PlanNode visitable) { if (visitable instanceof DualInputPlanNode && visitable.getProgramOperator() instanceof InnerJoinOperatorBase) { DualInputPlanNode node = ((DualInputPlanNode) visitable); final Channel inConn1 = node.getInput1(); final Channel inConn2 = node.getInput2(); Assert.assertTrue("Join should just forward the input if it is already partitioned", inConn1.getShipStrategy() == ShipStrategyType.FORWARD); Assert.assertTrue("Join should just forward the input if it is already partitioned", inConn2.getShipStrategy() == ShipStrategyType.FORWARD); return false; } return true; }
@Override public void accept(Visitor<PlanNode> visitor) { if (visitor.preVisit(this)) { this.input.getSource().accept(visitor); for (Channel broadcastInput : getBroadcastInputs()) { broadcastInput.getSource().accept(visitor); } visitor.postVisit(this); } }
public boolean unionsStaticAndDynamicPath() { return getInput1().isOnDynamicPath() != getInput2().isOnDynamicPath(); }
public void setCosts(Costs nodeCosts) { // add the costs from the step function nodeCosts.addCosts(this.rootOfStepFunction.getCumulativeCosts()); // add the costs for the termination criterion, if it exists // the costs are divided at branches, so we can simply add them up if (rootOfTerminationCriterion != null) { nodeCosts.addCosts(this.rootOfTerminationCriterion.getCumulativeCosts()); } super.setCosts(nodeCosts); }
/** * Gets the predecessor of this node, i.e. the source of the input channel. * * @return The predecessor of this node. */ public PlanNode getPredecessor() { return this.input.getSource(); }
@Override public SingleInputPlanNode instantiate(Channel in, SingleInputNode node) { return new SingleInputPlanNode(node, "Sort-Partition", in, DriverStrategy.UNARY_NO_OP); }
public void setShipStrategy(ShipStrategyType strategy, FieldList keys, Partitioner<?> partitioner, DataExchangeMode dataExchangeMode) { setShipStrategy(strategy, keys, null, partitioner, dataExchangeMode); }
public WorksetIterationPlanNode(WorksetIterationNode template, String nodeName, Channel initialSolutionSet, Channel initialWorkset, SolutionSetPlanNode solutionSetPlanNode, WorksetPlanNode worksetPlanNode, PlanNode nextWorkSetPlanNode, PlanNode solutionSetDeltaPlanNode) { super(template, nodeName, initialSolutionSet, initialWorkset, DriverStrategy.BINARY_NO_OP); this.solutionSetPlanNode = solutionSetPlanNode; this.worksetPlanNode = worksetPlanNode; this.solutionSetDeltaPlanNode = solutionSetDeltaPlanNode; this.nextWorkSetPlanNode = nextWorkSetPlanNode; mergeBranchPlanMaps(); }
public BulkIterationPlanNode(BulkIterationNode template, String nodeName, Channel input, BulkPartialSolutionPlanNode pspn, PlanNode rootOfStepFunction) { super(template, nodeName, input, DriverStrategy.NONE); this.partialSolutionPlanNode = pspn; this.rootOfStepFunction = rootOfStepFunction; mergeBranchPlanMaps(); }
@Override public DualInputPlanNode instantiate(Channel in1, Channel in2, TwoInputNode node) { return new BinaryUnionPlanNode((BinaryUnionNode) node, in1, in2); }
private boolean checkBroadcastShipStrategies(DualInputPlanNode join, SingleInputPlanNode reducer, SingleInputPlanNode combiner) { if (ShipStrategyType.BROADCAST == join.getInput1().getShipStrategy() && ShipStrategyType.FORWARD == join.getInput2().getShipStrategy() && ShipStrategyType.PARTITION_HASH == reducer.getInput().getShipStrategy()) { // check combiner Assert.assertNotNull("Plan should have a combiner", combiner); Assert.assertEquals(ShipStrategyType.FORWARD, combiner.getInput().getShipStrategy()); return true; } else { return false; } }