Class SavepointUtils
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.utils.SavepointUtils
-
public class SavepointUtils extends java.lang.ObjectSavepoint utilities.
-
-
Constructor Summary
Constructors Constructor Description SavepointUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcreateSavepointError(SavepointInfo savepointInfo, java.lang.Long triggerNonce)static booleangracePeriodEnded(org.apache.flink.configuration.Configuration conf, SavepointInfo savepointInfo)static voidresetTriggerIfJobNotRunning(AbstractFlinkResource<?,?> resource, EventRecorder eventRecorder)static booleansavepointInProgress(JobStatus jobStatus)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 correctSavepointTriggerType.static booleantriggerSavepointIfNeeded(FlinkService flinkService, AbstractFlinkResource<?,?> resource, org.apache.flink.configuration.Configuration conf)Triggers any pending manual or periodic savepoints and updates the status accordingly.
-
-
-
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-FlinkServiceused to trigger savepointsresource- Resource that should be savepointedconf- 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 correctSavepointTriggerType.This logic is responsible for both manual and periodic savepoint triggering.
- Parameters:
resource- Resource to be savepointedconf- Observe configuration of the resource- Returns:
- Optional @
SavepointTriggerType
-
gracePeriodEnded
public static boolean gracePeriodEnded(org.apache.flink.configuration.Configuration conf, SavepointInfo savepointInfo)
-
resetTriggerIfJobNotRunning
public static void resetTriggerIfJobNotRunning(AbstractFlinkResource<?,?> resource, EventRecorder eventRecorder)
-
createSavepointError
public static java.lang.String createSavepointError(SavepointInfo savepointInfo, java.lang.Long triggerNonce)
-
-