Class SavepointUtils
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.utils.SavepointUtils
-
public class SavepointUtils extends java.lang.Object
Savepoint utilities.
-
-
Constructor Summary
Constructors Constructor Description SavepointUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
createSavepointError(SavepointInfo savepointInfo, java.lang.Long triggerNonce)
static SavepointStatus
getLastSavepointStatus(AbstractFlinkResource<?,?> resource)
static org.apache.flink.core.execution.SavepointFormatType
getSavepointFormatType(org.apache.flink.configuration.Configuration configuration)
static boolean
gracePeriodEnded(org.apache.flink.configuration.Configuration conf, SavepointInfo savepointInfo)
static void
resetTriggerIfJobNotRunning(AbstractFlinkResource<?,?> resource, EventRecorder eventRecorder)
static boolean
savepointInProgress(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 boolean
triggerSavepointIfNeeded(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)
-
getLastSavepointStatus
public static SavepointStatus getLastSavepointStatus(AbstractFlinkResource<?,?> resource)
-
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 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)
-
getSavepointFormatType
public static org.apache.flink.core.execution.SavepointFormatType getSavepointFormatType(org.apache.flink.configuration.Configuration configuration)
-
-