Interface StreamGraphOptimizationStrategy

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface StreamGraphOptimizationStrategy
    Defines an optimization strategy for StreamGraph. Implementors of this interface provide methods to modify and optimize a StreamGraph based on contexts provided at runtime.
    • Field Detail

      • STREAM_GRAPH_OPTIMIZATION_STRATEGY

        @Internal
        static final org.apache.flink.configuration.ConfigOption<List<String>> STREAM_GRAPH_OPTIMIZATION_STRATEGY
    • Method Detail

      • initialize

        default void initialize​(StreamGraphContext context)
        Initializes the StreamGraphOptimizationStrategy with the provided StreamGraphContext.
        Parameters:
        context - the StreamGraphContext with a read-only view of a StreamGraph, providing methods to modify StreamEdges and StreamNodes within the StreamGraph.
      • onOperatorsFinished

        boolean onOperatorsFinished​(OperatorsFinished operatorsFinished,
                                    StreamGraphContext context)
                             throws Exception
        Tries to optimize the StreamGraph using the provided OperatorsFinished and StreamGraphContext. The method returns a boolean indicating whether the StreamGraph was successfully optimized.
        Parameters:
        operatorsFinished - the OperatorsFinished object containing information about completed operators and their produced data size and distribution information.
        context - the StreamGraphContext with a read-only view of a StreamGraph, providing methods to modify StreamEdges and StreamNodes within the StreamGraph.
        Returns:
        true if the StreamGraph was successfully optimized; false otherwise.
        Throws:
        Exception