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 for AdaptiveGraphGenerator.
  • Constructor Details

  • Method Details

    • 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 interface AdaptiveGraphGenerator
      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 interface AdaptiveGraphGenerator
      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 interface AdaptiveGraphGenerator
      Parameters:
      finishedJobVertexId - The ID of the completed JobVertex.
      Returns:
      A list of the newly added JobVertex instances to the JobGraph.
    • addFinishedStreamNodeIds

      public void addFinishedStreamNodeIds(List<Integer> finishedStreamNodeIds)
    • 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 interface StreamGraphContext.StreamGraphUpdateListener