in flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractJobReconciler.java [617:675]
protected abstract boolean cancelJob(FlinkResourceContext<CR> ctx, SuspendMode suspendMode)
throws Exception;
/**
* Removes a failed job.
*
* @param ctx Reconciler context.
* @throws Exception Error during cancellation.
*/
protected abstract void cleanupAfterFailedJob(FlinkResourceContext<CR> ctx) throws Exception;
/** Object to capture available upgrade mode. */
@Value
public static class JobUpgrade {
SuspendMode suspendMode;
UpgradeMode restoreMode;
boolean available;
boolean allowFallback;
boolean allowOtherReconcileActions;
static JobUpgrade stateless(boolean terminal) {
return new JobUpgrade(
terminal ? SuspendMode.NOOP : SuspendMode.STATELESS,
UpgradeMode.STATELESS,
true,
false,
false);
}
static JobUpgrade savepoint(boolean terminal) {
return new JobUpgrade(
terminal ? SuspendMode.NOOP : SuspendMode.SAVEPOINT,
UpgradeMode.SAVEPOINT,
true,
false,
false);
}
static JobUpgrade lastStateUsingHaMeta() {
return new JobUpgrade(
SuspendMode.LAST_STATE, UpgradeMode.LAST_STATE, true, false, false);
}
static JobUpgrade lastStateUsingCancel() {
return new JobUpgrade(SuspendMode.CANCEL, UpgradeMode.SAVEPOINT, true, false, false);
}
static JobUpgrade pendingCancellation() {
return new JobUpgrade(null, null, false, false, false);
}
static JobUpgrade pendingUpgrade() {
return new JobUpgrade(null, null, false, false, true);
}
static JobUpgrade unavailable() {
return new JobUpgrade(null, null, false, true, true);
}
}