Interface StreamGraphContext

All Known Implementing Classes:
DefaultStreamGraphContext

@Internal public interface StreamGraphContext
Defines a context for optimizing and working with a read-only view of a StreamGraph. It provides methods to modify StreamEdges and StreamNodes within the StreamGraph.
  • Method Details

    • getStreamGraph

      ImmutableStreamGraph getStreamGraph()
      Returns a read-only view of the StreamGraph.
      Returns:
      a read-only view of the StreamGraph.
    • getOperatorFactory

      @Nullable StreamOperatorFactory<?> getOperatorFactory(Integer streamNodeId)
      Retrieves the StreamOperatorFactory for the specified stream node id.
      Parameters:
      streamNodeId - the id of the stream node
      Returns:
      the StreamOperatorFactory associated with the given streamNodeId, or null if no operator factory is available.
    • modifyStreamEdge

      boolean modifyStreamEdge(List<StreamEdgeUpdateRequestInfo> requestInfos)
      Atomically 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.

      Parameters:
      requestInfos - the stream edges to be modified.
      Returns:
      true if all modifications were successful and applied atomically, false otherwise.
    • modifyStreamNode

      boolean modifyStreamNode(List<StreamNodeUpdateRequestInfo> requestInfos)
      Modifies stream nodes within the StreamGraph.
      Parameters:
      requestInfos - the stream nodes to be modified.
      Returns:
      true if the modification was successful, false otherwise.
    • checkUpstreamNodesFinished

      boolean checkUpstreamNodesFinished(ImmutableStreamNode streamNode, @Nullable Integer typeNumber)
      Check 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.
      Parameters:
      streamNode - the stream node that needs to be determined.
      Returns:
      true if all upstream nodes are finished, false otherwise.
    • getConsumedIntermediateDataSetId

      IntermediateDataSetID getConsumedIntermediateDataSetId(String edgeId)
      Retrieves the IntermediateDataSetID consumed by the specified edge.
      Parameters:
      edgeId - id of the edge
      Returns:
      the consumed IntermediateDataSetID
    • getOutputPartitioner

      @Nullable StreamPartitioner<?> getOutputPartitioner(String edgeId, Integer sourceId, Integer targetId)
      Gets the output partitioner of the specified edge.
      Parameters:
      edgeId - id of the edge
      sourceId - source node id of the edge
      targetId - target node id of the edge
      Returns:
      the output partitioner