Class SnapshotUtils

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

      • SnapshotUtils

        public SnapshotUtils()
    • Method Detail

      • savepointInProgress

        public static boolean savepointInProgress​(JobStatus jobStatus)
      • checkpointInProgress

        public static boolean checkpointInProgress​(JobStatus jobStatus)
      • triggerSnapshotIfNeeded

        public static boolean triggerSnapshotIfNeeded​(FlinkService flinkService,
                                                      AbstractFlinkResource<?,​?> resource,
                                                      org.apache.flink.configuration.Configuration conf,
                                                      SnapshotType snapshotType)
                                               throws java.lang.Exception
        Triggers any pending manual or periodic snapshots and updates the status accordingly.
        flinkService - The FlinkService used to trigger snapshots.
        resource - The resource that should be snapshotted.
        conf - The observe config of the resource.
        True if a snapshot was triggered.
        java.lang.Exception - An error during snapshot triggering.
      • shouldTriggerSnapshot

        protected static java.util.Optional<SnapshotTriggerType> shouldTriggerSnapshot​(AbstractFlinkResource<?,​?> resource,
                                                                                       org.apache.flink.configuration.Configuration conf,
                                                                                       SnapshotType snapshotType)
        Checks whether a snapshot should be triggered based on the current status and spec, and if yes, returns the correct SnapshotTriggerType.

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

        resource - The resource to be snapshotted.
        conf - The observe configuration of the resource.
        snapshotType - The type of the snapshot.
        An optional SnapshotTriggerType.
      • isSnapshotTriggeringSupported

        public static boolean isSnapshotTriggeringSupported​(org.apache.flink.configuration.Configuration conf)
      • gracePeriodEnded

        public static boolean gracePeriodEnded​(java.time.Duration gracePeriod,
                                               SnapshotInfo snapshotInfo)
      • resetSnapshotTriggers

        public static void resetSnapshotTriggers​(AbstractFlinkResource<?,​?> resource,
                                                 EventRecorder eventRecorder,
                                                 io.fabric8.kubernetes.client.KubernetesClient client)