Class AdaptiveGraphManager
- java.lang.Object
-
- org.apache.flink.streaming.api.graph.AdaptiveGraphManager
-
- All Implemented Interfaces:
AdaptiveGraphGenerator
,StreamGraphContext.StreamGraphUpdateListener
@Internal public class AdaptiveGraphManager extends Object implements AdaptiveGraphGenerator, StreamGraphContext.StreamGraphUpdateListener
Default implementation forAdaptiveGraphGenerator
.
-
-
Constructor Summary
Constructors Constructor Description AdaptiveGraphManager(ClassLoader userClassloader, StreamGraph streamGraph, Executor serializationExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFinishedStreamNodeIds(List<Integer> finishedStreamNodeIds)
Optional<JobVertexID>
findVertexByStreamNodeId(int streamNodeId)
JobGraph
getJobGraph()
Retrieves the JobGraph representation of the current state of the Flink job.List<StreamEdge>
getOutputStreamEdges(IntermediateDataSetID intermediateDataSetId)
Retrieves the stream edges that subscribe to the IntermediateDataSet.int
getPendingOperatorsCount()
Retrieves the number of operators that have not yet been converted to job vertex.Integer
getProducerStreamNodeId(IntermediateDataSetID intermediateDataSetId)
Retrieves the ID of the stream node that produces the IntermediateDataSet.StreamGraphContext
getStreamGraphContext()
Retrieves the StreamGraphContext which provides a read-only view of the StreamGraph and methods to modify its StreamEdges and StreamNodes.String
getStreamGraphJson()
StreamNodeForwardGroup
getStreamNodeForwardGroupByVertexId(JobVertexID jobVertexId)
Retrieves the StreamNodeForwardGroup which provides a stream node level ForwardGroup.List<Integer>
getStreamNodeIdsByJobVertexId(JobVertexID jobVertexId)
Retrieves the IDs of stream nodes that belong to the given job vertex.List<JobVertex>
onJobVertexFinished(JobVertexID finishedJobVertexId)
Responds to notifications that a JobVertex has completed execution.void
onStreamGraphUpdated()
This method is called whenever the StreamGraph is updated.
-
-
-
Constructor Detail
-
AdaptiveGraphManager
public AdaptiveGraphManager(ClassLoader userClassloader, StreamGraph streamGraph, Executor serializationExecutor)
-
-
Method Detail
-
getJobGraph
public JobGraph getJobGraph()
Description copied from interface:AdaptiveGraphGenerator
Retrieves the JobGraph representation of the current state of the Flink job.- Specified by:
getJobGraph
in interfaceAdaptiveGraphGenerator
- Returns:
- The
JobGraph
instance.
-
getStreamGraphContext
public StreamGraphContext getStreamGraphContext()
Description copied from interface:AdaptiveGraphGenerator
Retrieves the StreamGraphContext which provides a read-only view of the StreamGraph and methods to modify its StreamEdges and StreamNodes.- Specified by:
getStreamGraphContext
in interfaceAdaptiveGraphGenerator
- Returns:
- an instance of
StreamGraphContext
.
-
onJobVertexFinished
public List<JobVertex> onJobVertexFinished(JobVertexID finishedJobVertexId)
Description copied from interface:AdaptiveGraphGenerator
Responds to notifications that a JobVertex has completed execution. This method generates new job vertices, incorporates them into the JobGraph, and returns a list of the newly created JobVertex instances.- Specified by:
onJobVertexFinished
in interfaceAdaptiveGraphGenerator
- Parameters:
finishedJobVertexId
- The ID of the completed JobVertex.- Returns:
- A list of the newly added
JobVertex
instances to the JobGraph.
-
getStreamNodeForwardGroupByVertexId
public StreamNodeForwardGroup getStreamNodeForwardGroupByVertexId(JobVertexID jobVertexId)
Retrieves the StreamNodeForwardGroup which provides a stream node level ForwardGroup.- Parameters:
jobVertexId
- The ID of the JobVertex.- Returns:
- An instance of
StreamNodeForwardGroup
.
-
getPendingOperatorsCount
public int getPendingOperatorsCount()
Retrieves the number of operators that have not yet been converted to job vertex.- Returns:
- The number of unconverted operators.
-
getStreamNodeIdsByJobVertexId
public List<Integer> getStreamNodeIdsByJobVertexId(JobVertexID jobVertexId)
Retrieves the IDs of stream nodes that belong to the given job vertex.- Parameters:
jobVertexId
- The ID of the JobVertex.- Returns:
- A list of IDs of stream nodes that belong to the job vertex.
-
getProducerStreamNodeId
public Integer getProducerStreamNodeId(IntermediateDataSetID intermediateDataSetId)
Retrieves the ID of the stream node that produces the IntermediateDataSet.- Parameters:
intermediateDataSetId
- The ID of the IntermediateDataSet.- Returns:
- The ID of the stream node that produces the IntermediateDataSet.
-
getOutputStreamEdges
public List<StreamEdge> getOutputStreamEdges(IntermediateDataSetID intermediateDataSetId)
Retrieves the stream edges that subscribe to the IntermediateDataSet.- Parameters:
intermediateDataSetId
- the ID of the IntermediateDataSet- Returns:
- the stream edges that subscribe to the IntermediateDataSet
-
findVertexByStreamNodeId
public Optional<JobVertexID> findVertexByStreamNodeId(int streamNodeId)
-
getStreamGraphJson
public String getStreamGraphJson()
-
onStreamGraphUpdated
public void onStreamGraphUpdated()
Description copied from interface:StreamGraphContext.StreamGraphUpdateListener
This method is called whenever the StreamGraph is updated.- Specified by:
onStreamGraphUpdated
in interfaceStreamGraphContext.StreamGraphUpdateListener
-
-