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 void
initialize(StreamGraphContext context)
Initializes the StreamGraphOptimizationStrategy with the providedStreamGraphContext
.boolean
onOperatorsFinished(OperatorsFinished operatorsFinished, StreamGraphContext context)
Tries to optimize the StreamGraph using the providedOperatorsFinished
andStreamGraphContext
.
-
-
-
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 providedOperatorsFinished
andStreamGraphContext
. 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
-
-