Class SavepointUtils


  • public class SavepointUtils
    extends java.lang.Object
    Savepoint utilities.
    • Constructor Detail

      • SavepointUtils

        public SavepointUtils()
    • Method Detail

      • savepointInProgress

        public static boolean savepointInProgress​(JobStatus jobStatus)
      • triggerSavepointIfNeeded

        public static boolean triggerSavepointIfNeeded​(FlinkService flinkService,
                                                       AbstractFlinkResource<?,​?> resource,
                                                       org.apache.flink.configuration.Configuration conf)
                                                throws java.lang.Exception
        Triggers any pending manual or periodic savepoints and updates the status accordingly.
        Parameters:
        flinkService - FlinkService used to trigger savepoints
        resource - Resource that should be savepointed
        conf - Observe config of the resource
        Returns:
        True if a savepoint was triggered
        Throws:
        java.lang.Exception - Error during savepoint triggering.
      • shouldTriggerSavepoint

        @VisibleForTesting
        protected static java.util.Optional<SavepointTriggerType> shouldTriggerSavepoint​(AbstractFlinkResource<?,​?> resource,
                                                                                         org.apache.flink.configuration.Configuration conf)
        Checks whether savepoint should be triggered based on the current status and spec and if yes, returns the correct SavepointTriggerType.

        This logic is responsible for both manual and periodic savepoint triggering.

        Parameters:
        resource - Resource to be savepointed
        conf - Observe configuration of the resource
        Returns:
        Optional @SavepointTriggerType
      • gracePeriodEnded

        public static boolean gracePeriodEnded​(org.apache.flink.configuration.Configuration conf,
                                               SavepointInfo savepointInfo)
      • createSavepointError

        public static java.lang.String createSavepointError​(SavepointInfo savepointInfo,
                                                            java.lang.Long triggerNonce)
      • getSavepointFormatType

        public static org.apache.flink.core.execution.SavepointFormatType getSavepointFormatType​(org.apache.flink.configuration.Configuration configuration)