public abstract class TwoInputNode extends OptimizerNode
OptimizerNode.UnclosedBranchDescriptor| Modifier and Type | Field and Description |
|---|---|
protected PactConnection |
input1 |
protected PactConnection |
input2 |
protected FieldList |
keys1 |
protected FieldList |
keys2 |
cachedPlans, closedBranchingNodes, costWeight, estimatedNumRecords, estimatedOutputSize, hereJoinedBranches, id, MAX_DYNAMIC_PATH_COST_WEIGHT, onDynamicPath, openBranches, remappedKeys, uniqueFields| Constructor and Description |
|---|
TwoInputNode(DualInputOperator<?,?,?,?> pactContract)
Creates a new node with a single input for the optimizer plan.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Visitor<OptimizerNode> visitor)
This method implements the visit of a depth-first graph traversing visitor.
|
protected void |
addLocalCandidates(Channel template1,
Channel template2,
List<Set<? extends NamedChannel>> broadcastPlanChannels,
RequestedGlobalProperties rgps1,
RequestedGlobalProperties rgps2,
List<PlanNode> target,
OperatorDescriptorDual.LocalPropertiesPair[] validLocalCombinations,
CostEstimator estimator) |
void |
computeInterestingPropertiesForInputs(CostEstimator estimator)
Tells the node to compute the interesting properties for its inputs.
|
void |
computeUnclosedBranchStack()
This method causes the node to compute the description of open branches in its sub-plan.
|
List<PlanNode> |
getAlternativePlans(CostEstimator estimator)
Computes the plan alternatives for this node, an implicitly for all nodes that are children of
this node.
|
PactConnection |
getFirstIncomingConnection()
Gets the PactConnection through which this node receives its first input.
|
OptimizerNode |
getFirstPredecessorNode() |
List<PactConnection> |
getIncomingConnections()
This method needs to be overridden by subclasses to return the children.
|
FieldList |
getInputKeySet(int input)
Returns the key fields of the given input.
|
DualInputOperator<?,?,?,?> |
getPactContract()
Gets the object that specifically describes the contract of this node.
|
protected abstract List<OperatorDescriptorDual> |
getPossibleProperties() |
PactConnection |
getSecondIncomingConnection()
Gets the PactConnection through which this node receives its second input.
|
OptimizerNode |
getSecondPredecessorNode() |
protected boolean |
haveValidOutputEstimates(OptimizerNode subPlan)
Checks if the subPlan has a valid outputSize estimation.
|
protected void |
instantiate(OperatorDescriptorDual operator,
Channel in1,
Channel in2,
List<Set<? extends NamedChannel>> broadcastPlanChannels,
List<PlanNode> target,
CostEstimator estimator,
RequestedGlobalProperties globPropsReq1,
RequestedGlobalProperties globPropsReq2,
RequestedLocalProperties locPropsReq1,
RequestedLocalProperties locPropsReq2) |
boolean |
isFieldConstant(int input,
int fieldNumber)
Checks whether a field is modified by the user code or whether it is kept unchanged.
|
protected void |
placePipelineBreakersIfNecessary(DriverStrategy strategy,
Channel in1,
Channel in2) |
void |
setInput(Map<Operator<?>,OptimizerNode> contractToNode)
This function is for plan translation purposes.
|
addBroadcastConnection, addClosedBranch, addClosedBranches, addOutgoingConnection, areBranchCompatible, clearInterestingProperties, computeOperatorSpecificDefaultEstimates, computeOutputEstimates, computeUnclosedBranchStackForBroadcastInputs, computeUnionOfInterestingPropertiesFromSuccessors, createUniqueFieldsForNode, getBranchesForParent, getBroadcastConnectionNames, getBroadcastConnections, getClosedBranchingNodes, getConstantKeySet, getCostWeight, getDegreeOfParallelism, getDumpableInputs, getEstimatedAvgWidthPerOutputRecord, getEstimatedNumRecords, getEstimatedOutputSize, getId, getInterestingProperties, getMaxDepth, getMinimalMemoryAcrossAllSubTasks, getName, getOpenBranches, getOptimizerNode, getOutgoingConnections, getPlanNode, getPredecessors, getRemappedKeys, getUniqueFields, hasUnclosedBranches, haveAllOutputConnectionInterestingProperties, identifyDynamicPath, initId, isBranching, isOnDynamicPath, mergeLists, prunePlanAlternatives, prunePlanAlternativesWithCommonBranching, readStubAnnotations, readUniqueFieldsAnnotation, removeClosedBranches, setBroadcastInputs, setDegreeOfParallelism, setEstimatedNumRecords, setEstimatedOutputSize, toStringprotected final FieldList keys1
protected final FieldList keys2
protected PactConnection input1
protected PactConnection input2
public TwoInputNode(DualInputOperator<?,?,?,?> pactContract)
pactContract - The PACT that the node represents.public DualInputOperator<?,?,?,?> getPactContract()
OptimizerNodegetPactContract in class OptimizerNodepublic PactConnection getFirstIncomingConnection()
public PactConnection getSecondIncomingConnection()
public OptimizerNode getFirstPredecessorNode()
public OptimizerNode getSecondPredecessorNode()
public List<PactConnection> getIncomingConnections()
OptimizerNodegetIncomingConnections in class OptimizerNodepublic void setInput(Map<Operator<?>,OptimizerNode> contractToNode)
OptimizerNodeIn addition, the nodes must set the shipping strategy of the connection, if a suitable optimizer hint is found.
setInput in class OptimizerNodecontractToNode - The map to translate the contracts to their corresponding optimizer nodes.protected abstract List<OperatorDescriptorDual> getPossibleProperties()
public void computeInterestingPropertiesForInputs(CostEstimator estimator)
OptimizerNodecomputeInterestingPropertiesForInputs in class OptimizerNodeestimator - The CostEstimator instance to use for plan cost estimation.public List<PlanNode> getAlternativePlans(CostEstimator estimator)
OptimizerNodegetAlternatives() on its children
to get their plan alternatives, and build its own alternatives on top of those.getAlternativePlans in class OptimizerNodeestimator - The cost estimator used to estimate the costs of each plan alternative.protected void addLocalCandidates(Channel template1, Channel template2, List<Set<? extends NamedChannel>> broadcastPlanChannels, RequestedGlobalProperties rgps1, RequestedGlobalProperties rgps2, List<PlanNode> target, OperatorDescriptorDual.LocalPropertiesPair[] validLocalCombinations, CostEstimator estimator)
protected void instantiate(OperatorDescriptorDual operator, Channel in1, Channel in2, List<Set<? extends NamedChannel>> broadcastPlanChannels, List<PlanNode> target, CostEstimator estimator, RequestedGlobalProperties globPropsReq1, RequestedGlobalProperties globPropsReq2, RequestedLocalProperties locPropsReq1, RequestedLocalProperties locPropsReq2)
protected void placePipelineBreakersIfNecessary(DriverStrategy strategy, Channel in1, Channel in2)
protected boolean haveValidOutputEstimates(OptimizerNode subPlan)
subPlan - The subPlan to check.True, if all values are valid, false otherwisepublic void computeUnclosedBranchStack()
OptimizerNodeopenBranches field to a stack of unclosed branches, the
latest one top. A branch is considered closed, if some later node sees all of the branching node's outputs,
no matter if there have been more branches to different paths in the meantime.computeUnclosedBranchStack in class OptimizerNodepublic FieldList getInputKeySet(int input)
input - The input for which key fields must be returned.public boolean isFieldConstant(int input,
int fieldNumber)
OptimizerNodeisFieldConstant in class OptimizerNodeinput - The input number.fieldNumber - The position of the field.public void accept(Visitor<OptimizerNode> visitor)
OptimizerNodepreVisit() method, then hand the visitor to their children, and finally call
the postVisit() method.accept in interface Visitable<OptimizerNode>accept in class OptimizerNodevisitor - The graph traversing visitor.Visitable.accept(org.apache.flink.util.Visitor)Copyright © 2014 The Apache Software Foundation. All rights reserved.