Package org.apache.flink.optimizer.dag
Class DagConnection
- java.lang.Object
-
- org.apache.flink.optimizer.dag.DagConnection
-
- All Implemented Interfaces:
EstimateProvider,DumpableConnection<OptimizerNode>
public class DagConnection extends Object implements EstimateProvider, DumpableConnection<OptimizerNode>
A connection between two operators. Represents an intermediate result and a data exchange between the two operators.The data exchange has a mode in which it performs (batch / pipelined).
The data exchange strategy may be set on this connection, in which case it is fixed and will not be determined during candidate plan enumeration.
During the enumeration of interesting properties, this connection also holds all interesting properties generated by the successor operator.
-
-
Constructor Summary
Constructors Constructor Description DagConnection(OptimizerNode source, org.apache.flink.api.common.ExecutionMode exchangeMode)Constructor to create a result from an operator that is not consumed by another operator.DagConnection(OptimizerNode source, OptimizerNode target, org.apache.flink.api.common.ExecutionMode exchangeMode)Creates a new Connection between two nodes.DagConnection(OptimizerNode source, OptimizerNode target, org.apache.flink.runtime.operators.shipping.ShipStrategyType shipStrategy, org.apache.flink.api.common.ExecutionMode exchangeMode)Creates a new Connection between two nodes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearInterestingProperties()intgetCostWeight()org.apache.flink.api.common.ExecutionModegetDataExchangeMode()Gets the data exchange mode to use for this connection.floatgetEstimatedAvgWidthPerOutputRecord()Gets the estimated number of bytes per record.longgetEstimatedNumRecords()Gets the estimated number of records in the output of this node.longgetEstimatedOutputSize()Gets the estimated output size from this node.InterestingPropertiesgetInterestingProperties()Gets the interesting properties object for this pact connection.TempModegetMaterializationMode()intgetMaxDepth()org.apache.flink.runtime.operators.shipping.ShipStrategyTypegetShipStrategy()Gets the shipping strategy for this connection.OptimizerNodegetSource()Gets the source of the connection.OptimizerNodegetTarget()Gets the target of the connection.voidinitMaxDepth()booleanisBreakingPipeline()Checks whether this connection is marked to break the pipeline.booleanisOnDynamicPath()voidmarkBreaksPipeline()Marks that this connection should do a decoupled data exchange (such as batched) rather then pipeline data.voidsetInterestingProperties(InterestingProperties props)Sets the interesting properties for this pact connection.voidsetMaterializationMode(TempMode materializationMode)voidsetShipStrategy(org.apache.flink.runtime.operators.shipping.ShipStrategyType strategy)Sets the shipping strategy for this connection.StringtoString()
-
-
-
Constructor Detail
-
DagConnection
public DagConnection(OptimizerNode source, OptimizerNode target, org.apache.flink.api.common.ExecutionMode exchangeMode)
Creates a new Connection between two nodes. The shipping strategy is by default null.- Parameters:
source- The source node.target- The target node.exchangeMode- The data exchange mode (pipelined / batch / batch only for shuffles / ... )
-
DagConnection
public DagConnection(OptimizerNode source, OptimizerNode target, org.apache.flink.runtime.operators.shipping.ShipStrategyType shipStrategy, org.apache.flink.api.common.ExecutionMode exchangeMode)
Creates a new Connection between two nodes.- Parameters:
source- The source node.target- The target node.shipStrategy- The shipping strategy.exchangeMode- The data exchange mode (pipelined / batch / batch only for shuffles / ... )
-
DagConnection
public DagConnection(OptimizerNode source, org.apache.flink.api.common.ExecutionMode exchangeMode)
Constructor to create a result from an operator that is not consumed by another operator.- Parameters:
source- The source node.exchangeMode- The data exchange mode (pipelined / batch / batch only for shuffles / ... )
-
-
Method Detail
-
getSource
public OptimizerNode getSource()
Gets the source of the connection.- Specified by:
getSourcein interfaceDumpableConnection<OptimizerNode>- Returns:
- The source Node.
-
getTarget
public OptimizerNode getTarget()
Gets the target of the connection.- Returns:
- The target node.
-
getShipStrategy
public org.apache.flink.runtime.operators.shipping.ShipStrategyType getShipStrategy()
Gets the shipping strategy for this connection.- Specified by:
getShipStrategyin interfaceDumpableConnection<OptimizerNode>- Returns:
- The connection's shipping strategy.
-
setShipStrategy
public void setShipStrategy(org.apache.flink.runtime.operators.shipping.ShipStrategyType strategy)
Sets the shipping strategy for this connection.- Parameters:
strategy- The shipping strategy to be applied to this connection.
-
getDataExchangeMode
public org.apache.flink.api.common.ExecutionMode getDataExchangeMode()
Gets the data exchange mode to use for this connection.- Returns:
- The data exchange mode to use for this connection.
-
markBreaksPipeline
public void markBreaksPipeline()
Marks that this connection should do a decoupled data exchange (such as batched) rather then pipeline data. Connections are marked as pipeline breakers to avoid deadlock situations.
-
isBreakingPipeline
public boolean isBreakingPipeline()
Checks whether this connection is marked to break the pipeline.- Returns:
- True, if this connection is marked to break the pipeline, false otherwise.
-
getInterestingProperties
public InterestingProperties getInterestingProperties()
Gets the interesting properties object for this pact connection. If the interesting properties for this connections have not yet been set, this method returns null.- Returns:
- The collection of all interesting properties, or null, if they have not yet been set.
-
setInterestingProperties
public void setInterestingProperties(InterestingProperties props)
Sets the interesting properties for this pact connection.- Parameters:
props- The interesting properties.
-
clearInterestingProperties
public void clearInterestingProperties()
-
initMaxDepth
public void initMaxDepth()
-
getMaxDepth
public int getMaxDepth()
-
getEstimatedOutputSize
public long getEstimatedOutputSize()
Description copied from interface:EstimateProviderGets the estimated output size from this node.- Specified by:
getEstimatedOutputSizein interfaceEstimateProvider- Returns:
- The estimated output size.
-
getEstimatedNumRecords
public long getEstimatedNumRecords()
Description copied from interface:EstimateProviderGets the estimated number of records in the output of this node.- Specified by:
getEstimatedNumRecordsin interfaceEstimateProvider- Returns:
- The estimated number of records.
-
getEstimatedAvgWidthPerOutputRecord
public float getEstimatedAvgWidthPerOutputRecord()
Description copied from interface:EstimateProviderGets the estimated number of bytes per record.- Specified by:
getEstimatedAvgWidthPerOutputRecordin interfaceEstimateProvider- Returns:
- The estimated number of bytes per record.
-
getMaterializationMode
public TempMode getMaterializationMode()
-
setMaterializationMode
public void setMaterializationMode(TempMode materializationMode)
-
isOnDynamicPath
public boolean isOnDynamicPath()
-
getCostWeight
public int getCostWeight()
-
-