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 org.apache.flink.api.common.operators.util.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(org.apache.flink.api.common.operators.util.FieldSet keys) |
protected |
SingleInputNode(SingleInputNode toCopy) |
protected |
SingleInputNode(org.apache.flink.api.common.operators.SingleInputOperator<?,?,?> programOperator)
Creates a new node with a single input for the optimizer plan.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(org.apache.flink.util.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.
|
org.apache.flink.api.common.operators.SingleInputOperator<?,?,?> |
getOperator()
Gets the operator represented by this optimizer node.
|
protected abstract List<OperatorDescriptorSingle> |
getPossibleProperties() |
OptimizerNode |
getPredecessorNode()
Gets the predecessor of this node.
|
org.apache.flink.api.common.operators.SemanticProperties |
getSemanticProperties() |
protected org.apache.flink.api.common.operators.SemanticProperties |
getSemanticPropertiesForGlobalPropertyFiltering() |
protected org.apache.flink.api.common.operators.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<org.apache.flink.api.common.operators.Operator<?>,OptimizerNode> contractToNode,
org.apache.flink.api.common.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, toStringprotected final org.apache.flink.api.common.operators.util.FieldSet keys
protected DagConnection inConn
protected SingleInputNode(org.apache.flink.api.common.operators.SingleInputOperator<?,?,?> programOperator)
programOperator - The PACT that the node represents.protected SingleInputNode(org.apache.flink.api.common.operators.util.FieldSet keys)
protected SingleInputNode()
protected SingleInputNode(SingleInputNode toCopy)
public org.apache.flink.api.common.operators.SingleInputOperator<?,?,?> getOperator()
OptimizerNodegetOperator in class OptimizerNodepublic DagConnection getIncomingConnection()
public void setIncomingConnection(DagConnection inConn)
inConn - The input connection to set.public OptimizerNode getPredecessorNode()
public List<DagConnection> getIncomingConnections()
OptimizerNodegetIncomingConnections in class OptimizerNodepublic org.apache.flink.api.common.operators.SemanticProperties getSemanticProperties()
getSemanticProperties in class OptimizerNodeprotected org.apache.flink.api.common.operators.SemanticProperties getSemanticPropertiesForLocalPropertyFiltering()
protected org.apache.flink.api.common.operators.SemanticProperties getSemanticPropertiesForGlobalPropertyFiltering()
public void setInput(Map<org.apache.flink.api.common.operators.Operator<?>,OptimizerNode> contractToNode, org.apache.flink.api.common.ExecutionMode defaultExchangeMode) throws CompilerException
OptimizerNodesetInput in class OptimizerNodecontractToNode - The map from program operators to optimizer nodes.defaultExchangeMode - The data exchange mode to use, if the operator does not specify
one.CompilerExceptionprotected abstract List<OperatorDescriptorSingle> 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 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()
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 void accept(org.apache.flink.util.Visitor<OptimizerNode> visitor)
OptimizerNodepreVisit() method, then hand the visitor to their children, and
finally call the postVisit() method.accept in interface org.apache.flink.util.Visitable<OptimizerNode>accept in class OptimizerNodevisitor - The graph traversing visitor.Visitable.accept(org.apache.flink.util.Visitor)Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.