public abstract class SingleInputNode extends OptimizerNode
This class contains all the generic logic for handling branching flows, as well as to enumerate candidate execution plans. The subclasses for specific operators simply add logic for cost estimates and specify possible strategies for their execution.
OptimizerNode.UnclosedBranchDescriptor
Modifier and Type | Field and Description |
---|---|
protected DagConnection |
inConn |
protected FieldSet |
keys |
cachedPlans, closedBranchingNodes, costWeight, estimatedNumRecords, estimatedOutputSize, hereJoinedBranches, id, MAX_DYNAMIC_PATH_COST_WEIGHT, onDynamicPath, openBranches, uniqueFields
Modifier | Constructor and Description |
---|---|
protected |
SingleInputNode() |
protected |
SingleInputNode(FieldSet keys) |
protected |
SingleInputNode(SingleInputNode toCopy) |
protected |
SingleInputNode(SingleInputOperator<?,?,?> programOperator)
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 template,
List<Set<? extends NamedChannel>> broadcastPlanChannels,
RequestedGlobalProperties rgps,
List<PlanNode> target,
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.
|
DagConnection |
getIncomingConnection()
Gets the input of this operator.
|
List<DagConnection> |
getIncomingConnections()
Gets all incoming connections of this node.
|
SingleInputOperator<?,?,?> |
getOperator()
Gets the operator represented by this optimizer node.
|
protected abstract List<OperatorDescriptorSingle> |
getPossibleProperties() |
OptimizerNode |
getPredecessorNode()
Gets the predecessor of this node.
|
SemanticProperties |
getSemanticProperties() |
protected SemanticProperties |
getSemanticPropertiesForGlobalPropertyFiltering() |
protected SemanticProperties |
getSemanticPropertiesForLocalPropertyFiltering() |
protected void |
instantiateCandidate(OperatorDescriptorSingle dps,
Channel in,
List<Set<? extends NamedChannel>> broadcastPlanChannels,
List<PlanNode> target,
CostEstimator estimator,
RequestedGlobalProperties globPropsReq,
RequestedLocalProperties locPropsReq) |
void |
setIncomingConnection(DagConnection inConn)
Sets the connection through which this node receives its input.
|
void |
setInput(Map<Operator<?>,OptimizerNode> contractToNode,
ExecutionMode defaultExchangeMode)
This function connects the predecessors to this operator.
|
addBroadcastConnection, addClosedBranch, addClosedBranches, addOutgoingConnection, areBranchCompatible, clearInterestingProperties, computeOperatorSpecificDefaultEstimates, computeOutputEstimates, computeUnclosedBranchStackForBroadcastInputs, computeUnionOfInterestingPropertiesFromSuccessors, getBranchesForParent, getBroadcastConnectionNames, getBroadcastConnections, getClosedBranchingNodes, getCostWeight, getDumpableInputs, getEstimatedAvgWidthPerOutputRecord, getEstimatedNumRecords, getEstimatedOutputSize, getId, getInterestingProperties, getMaxDepth, getMinimalMemoryAcrossAllSubTasks, getOpenBranches, getOperatorName, getOptimizerNode, getOutgoingConnections, getParallelism, getPlanNode, getPredecessors, getUniqueFields, hasUnclosedBranches, haveAllOutputConnectionInterestingProperties, identifyDynamicPath, initId, isBranching, isOnDynamicPath, markAllOutgoingConnectionsAsPipelineBreaking, mergeLists, prunePlanAlternatives, prunePlanAlternativesWithCommonBranching, readStubAnnotations, readUniqueFieldsAnnotation, removeClosedBranches, setBroadcastInputs, setEstimatedNumRecords, setEstimatedOutputSize, setParallelism, toString
protected final FieldSet keys
protected DagConnection inConn
protected SingleInputNode(SingleInputOperator<?,?,?> programOperator)
programOperator
- The PACT that the node represents.protected SingleInputNode(FieldSet keys)
protected SingleInputNode()
protected SingleInputNode(SingleInputNode toCopy)
public SingleInputOperator<?,?,?> getOperator()
OptimizerNode
getOperator
in class OptimizerNode
public DagConnection getIncomingConnection()
public void setIncomingConnection(DagConnection inConn)
inConn
- The input connection to set.public OptimizerNode getPredecessorNode()
public List<DagConnection> getIncomingConnections()
OptimizerNode
getIncomingConnections
in class OptimizerNode
public SemanticProperties getSemanticProperties()
getSemanticProperties
in class OptimizerNode
protected SemanticProperties getSemanticPropertiesForLocalPropertyFiltering()
protected SemanticProperties getSemanticPropertiesForGlobalPropertyFiltering()
public void setInput(Map<Operator<?>,OptimizerNode> contractToNode, ExecutionMode defaultExchangeMode) throws CompilerException
OptimizerNode
setInput
in class OptimizerNode
contractToNode
- The map from program operators to optimizer nodes.defaultExchangeMode
- The data exchange mode to use, if the operator does not specify
one.CompilerException
protected abstract List<OperatorDescriptorSingle> getPossibleProperties()
public void computeInterestingPropertiesForInputs(CostEstimator estimator)
OptimizerNode
computeInterestingPropertiesForInputs
in class OptimizerNode
estimator
- The CostEstimator
instance to use for plan cost estimation.public List<PlanNode> getAlternativePlans(CostEstimator estimator)
OptimizerNode
getAlternatives()
on its
children to get their plan alternatives, and build its own alternatives on top of those.getAlternativePlans
in class OptimizerNode
estimator
- The cost estimator used to estimate the costs of each plan alternative.protected void addLocalCandidates(Channel template, List<Set<? extends NamedChannel>> broadcastPlanChannels, RequestedGlobalProperties rgps, List<PlanNode> target, CostEstimator estimator)
protected void instantiateCandidate(OperatorDescriptorSingle dps, Channel in, List<Set<? extends NamedChannel>> broadcastPlanChannels, List<PlanNode> target, CostEstimator estimator, RequestedGlobalProperties globPropsReq, RequestedLocalProperties locPropsReq)
public void computeUnclosedBranchStack()
OptimizerNode
openBranches
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 OptimizerNode
public void accept(Visitor<OptimizerNode> visitor)
OptimizerNode
preVisit()
method, then hand the visitor to their children, and
finally call the postVisit()
method.accept
in interface Visitable<OptimizerNode>
accept
in class OptimizerNode
visitor
- The graph traversing visitor.Visitable.accept(org.apache.flink.util.Visitor)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.