Interface AutoScalerEventHandler<KEY,​Context extends JobAutoScalerContext<KEY>>

    • 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
    • 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 interface java.lang.AutoCloseable
        Specified by:
        close in interface java.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)