Class DefaultStreamGraphContext
java.lang.Object
org.apache.flink.streaming.api.graph.DefaultStreamGraphContext
- All Implemented Interfaces:
StreamGraphContext
Default implementation for
StreamGraphContext.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.streaming.api.graph.StreamGraphContext
StreamGraphContext.StreamGraphUpdateListener -
Constructor Summary
ConstructorsConstructorDescriptionDefaultStreamGraphContext(StreamGraph streamGraph, Map<Integer, StreamNodeForwardGroup> steamNodeIdToForwardGroupMap, Map<Integer, Integer> frozenNodeToStartNodeMap, Map<Integer, Map<StreamEdge, NonChainedOutput>> opIntermediateOutputsCaches, Map<String, IntermediateDataSet> consumerEdgeIdToIntermediateDataSetMap, Set<Integer> finishedStreamNodeIds, ClassLoader userClassloader) DefaultStreamGraphContext(StreamGraph streamGraph, Map<Integer, StreamNodeForwardGroup> steamNodeIdToForwardGroupMap, Map<Integer, Integer> frozenNodeToStartNodeMap, Map<Integer, Map<StreamEdge, NonChainedOutput>> opIntermediateOutputsCaches, Map<String, IntermediateDataSet> consumerEdgeIdToIntermediateDataSetMap, Set<Integer> finishedStreamNodeIds, ClassLoader userClassloader, StreamGraphContext.StreamGraphUpdateListener streamGraphUpdateListener) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckUpstreamNodesFinished(ImmutableStreamNode streamNode, Integer typeNumber) Check if the upstream nodes of the stream node with the specified type number have finished.Retrieves the IntermediateDataSetID consumed by the specified edge.getOperatorFactory(Integer streamNodeId) Retrieves theStreamOperatorFactoryfor the specified stream node id.getOutputPartitioner(String edgeId, Integer sourceId, Integer targetId) Gets the output partitioner of the specified edge.Returns a read-only view of the StreamGraph.booleanmodifyStreamEdge(List<StreamEdgeUpdateRequestInfo> requestInfos) Atomically modifies stream edges within the StreamGraph.booleanmodifyStreamNode(List<StreamNodeUpdateRequestInfo> requestInfos) Modifies stream nodes within the StreamGraph.
-
Constructor Details
-
DefaultStreamGraphContext
@VisibleForTesting public DefaultStreamGraphContext(StreamGraph streamGraph, Map<Integer, StreamNodeForwardGroup> steamNodeIdToForwardGroupMap, Map<Integer, Integer> frozenNodeToStartNodeMap, Map<Integer, Map<StreamEdge, NonChainedOutput>> opIntermediateOutputsCaches, Map<String, IntermediateDataSet> consumerEdgeIdToIntermediateDataSetMap, Set<Integer> finishedStreamNodeIds, ClassLoader userClassloader) -
DefaultStreamGraphContext
public DefaultStreamGraphContext(StreamGraph streamGraph, Map<Integer, StreamNodeForwardGroup> steamNodeIdToForwardGroupMap, Map<Integer, Integer> frozenNodeToStartNodeMap, Map<Integer, Map<StreamEdge, NonChainedOutput>> opIntermediateOutputsCaches, Map<String, IntermediateDataSet> consumerEdgeIdToIntermediateDataSetMap, Set<Integer> finishedStreamNodeIds, ClassLoader userClassloader, @Nullable StreamGraphContext.StreamGraphUpdateListener streamGraphUpdateListener)
-
-
Method Details
-
getStreamGraph
Description copied from interface:StreamGraphContextReturns a read-only view of the StreamGraph.- Specified by:
getStreamGraphin interfaceStreamGraphContext- Returns:
- a read-only view of the StreamGraph.
-
getOperatorFactory
Description copied from interface:StreamGraphContextRetrieves theStreamOperatorFactoryfor the specified stream node id.- Specified by:
getOperatorFactoryin interfaceStreamGraphContext- Parameters:
streamNodeId- the id of the stream node- Returns:
- the
StreamOperatorFactoryassociated with the givenstreamNodeId, ornullif no operator factory is available.
-
modifyStreamEdge
Description copied from interface:StreamGraphContextAtomically modifies stream edges within the StreamGraph.This method ensures that all the requested modifications to stream edges are applied atomically. This means that if any modification fails, none of the changes will be applied, maintaining the consistency of the StreamGraph.
- Specified by:
modifyStreamEdgein interfaceStreamGraphContext- Parameters:
requestInfos- the stream edges to be modified.- Returns:
- true if all modifications were successful and applied atomically, false otherwise.
-
modifyStreamNode
Description copied from interface:StreamGraphContextModifies stream nodes within the StreamGraph.- Specified by:
modifyStreamNodein interfaceStreamGraphContext- Parameters:
requestInfos- the stream nodes to be modified.- Returns:
- true if the modification was successful, false otherwise.
-
checkUpstreamNodesFinished
Description copied from interface:StreamGraphContextCheck if the upstream nodes of the stream node with the specified type number have finished. If the type number is null, evaluate the completion of all upstream processes.- Specified by:
checkUpstreamNodesFinishedin interfaceStreamGraphContext- Parameters:
streamNode- the stream node that needs to be determined.- Returns:
- true if all upstream nodes are finished, false otherwise.
-
getConsumedIntermediateDataSetId
Description copied from interface:StreamGraphContextRetrieves the IntermediateDataSetID consumed by the specified edge.- Specified by:
getConsumedIntermediateDataSetIdin interfaceStreamGraphContext- Parameters:
edgeId- id of the edge- Returns:
- the consumed IntermediateDataSetID
-
getOutputPartitioner
Description copied from interface:StreamGraphContextGets the output partitioner of the specified edge.- Specified by:
getOutputPartitionerin interfaceStreamGraphContext- Parameters:
edgeId- id of the edgesourceId- source node id of the edgetargetId- target node id of the edge- Returns:
- the output partitioner
-