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 Summary
Fields Modifier and Type Field Description static org.apache.flink.configuration.ConfigOption<List<String>>STREAM_GRAPH_OPTIMIZATION_STRATEGY
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidinitialize(StreamGraphContext context)Initializes the StreamGraphOptimizationStrategy with the providedStreamGraphContext.booleanonOperatorsFinished(OperatorsFinished operatorsFinished, StreamGraphContext context)Tries to optimize the StreamGraph using the providedOperatorsFinishedandStreamGraphContext.
-
-
-
Method Detail
-
initialize
default void initialize(StreamGraphContext context)
Initializes the StreamGraphOptimizationStrategy with the providedStreamGraphContext.- 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 providedOperatorsFinishedandStreamGraphContext. 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:
trueif the StreamGraph was successfully optimized;falseotherwise.- Throws:
Exception
-
-