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 voidaddFinishedStreamNodeIds(List<Integer> finishedStreamNodeIds)Optional<JobVertexID>findVertexByStreamNodeId(int streamNodeId)JobGraphgetJobGraph()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.intgetPendingOperatorsCount()Retrieves the number of operators that have not yet been converted to job vertex.IntegergetProducerStreamNodeId(IntermediateDataSetID intermediateDataSetId)Retrieves the ID of the stream node that produces the IntermediateDataSet.StreamGraphContextgetStreamGraphContext()Retrieves the StreamGraphContext which provides a read-only view of the StreamGraph and methods to modify its StreamEdges and StreamNodes.StringgetStreamGraphJson()StreamNodeForwardGroupgetStreamNodeForwardGroupByVertexId(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.voidonStreamGraphUpdated()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:AdaptiveGraphGeneratorRetrieves the JobGraph representation of the current state of the Flink job.- Specified by:
getJobGraphin interfaceAdaptiveGraphGenerator- Returns:
- The
JobGraphinstance.
-
getStreamGraphContext
public StreamGraphContext getStreamGraphContext()
Description copied from interface:AdaptiveGraphGeneratorRetrieves the StreamGraphContext which provides a read-only view of the StreamGraph and methods to modify its StreamEdges and StreamNodes.- Specified by:
getStreamGraphContextin interfaceAdaptiveGraphGenerator- Returns:
- an instance of
StreamGraphContext.
-
onJobVertexFinished
public List<JobVertex> onJobVertexFinished(JobVertexID finishedJobVertexId)
Description copied from interface:AdaptiveGraphGeneratorResponds 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:
onJobVertexFinishedin interfaceAdaptiveGraphGenerator- Parameters:
finishedJobVertexId- The ID of the completed JobVertex.- Returns:
- A list of the newly added
JobVertexinstances 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.StreamGraphUpdateListenerThis method is called whenever the StreamGraph is updated.- Specified by:
onStreamGraphUpdatedin interfaceStreamGraphContext.StreamGraphUpdateListener
-
-