Interface AutoScalerEventHandler<KEY,Context extends JobAutoScalerContext<KEY>>
-
- Type Parameters:
KEY
- The job key.Context
- Instance of JobAutoScalerContext.
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
JdbcAutoScalerEventHandler
,KubernetesAutoScalerEventHandler
,LoggingEventHandler
@Experimental public interface AutoScalerEventHandler<KEY,Context extends JobAutoScalerContext<KEY>> extends java.io.Closeable
Handler for autoscaler events.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AutoScalerEventHandler.Type
The type of the events.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SCALING_EXECUTION_DISABLED_REASON
static java.lang.String
SCALING_REPORT_KEY
static java.lang.String
SCALING_REPORT_REASON
static java.lang.String
SCALING_SUMMARY_ENTRY
static java.lang.String
SCALING_SUMMARY_HEADER_SCALING_EXECUTION_DISABLED
static java.lang.String
SCALING_SUMMARY_HEADER_SCALING_EXECUTION_ENABLED
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
Close the related resource.static java.lang.String
getParallelismHashCode(java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,ScalingSummary> scalingSummaryHashMap)
void
handleEvent(Context context, AutoScalerEventHandler.Type type, java.lang.String reason, java.lang.String message, java.lang.String messageKey, java.time.Duration interval)
Handle the event.default void
handleException(Context context, java.lang.String reason, java.lang.Throwable e)
Handle exception, and the exception event is warning type and don't deduplicate by default.default void
handleScalingEvent(Context context, java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,ScalingSummary> scalingSummaries, java.lang.String message, java.time.Duration interval)
Handle scaling reports.static java.lang.String
scalingReport(java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,ScalingSummary> scalingSummaries, java.lang.String message)
-
-
-
Field Detail
-
SCALING_SUMMARY_ENTRY
static final java.lang.String SCALING_SUMMARY_ENTRY
- See Also:
- Constant Field Values
-
SCALING_EXECUTION_DISABLED_REASON
static final java.lang.String SCALING_EXECUTION_DISABLED_REASON
- See Also:
- Constant Field Values
-
SCALING_SUMMARY_HEADER_SCALING_EXECUTION_DISABLED
static final java.lang.String SCALING_SUMMARY_HEADER_SCALING_EXECUTION_DISABLED
- See Also:
- Constant Field Values
-
SCALING_SUMMARY_HEADER_SCALING_EXECUTION_ENABLED
static final java.lang.String SCALING_SUMMARY_HEADER_SCALING_EXECUTION_ENABLED
- See Also:
- Constant Field Values
-
SCALING_REPORT_REASON
static final java.lang.String SCALING_REPORT_REASON
- See Also:
- Constant Field Values
-
SCALING_REPORT_KEY
static final java.lang.String SCALING_REPORT_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
handleEvent
void handleEvent(Context context, AutoScalerEventHandler.Type type, java.lang.String reason, java.lang.String message, @Nullable java.lang.String messageKey, @Nullable java.time.Duration interval)
Handle the event.- Parameters:
interval
- Define the interval to suppress duplicate events. No dedupe if null.
-
handleException
default void handleException(Context context, java.lang.String reason, java.lang.Throwable e)
Handle exception, and the exception event is warning type and don't deduplicate by default.
-
handleScalingEvent
default void handleScalingEvent(Context context, java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,ScalingSummary> scalingSummaries, java.lang.String message, java.time.Duration interval)
Handle scaling reports.- Parameters:
interval
- Define the interval to suppress duplicate events.message
- Message describe the event.
-
close
default void close()
Close the related resource.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
scalingReport
static java.lang.String scalingReport(java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,ScalingSummary> scalingSummaries, java.lang.String message)
-
getParallelismHashCode
static java.lang.String getParallelismHashCode(java.util.Map<org.apache.flink.runtime.jobgraph.JobVertexID,ScalingSummary> scalingSummaryHashMap)
-
-