SteNicholas commented on a change in pull request #48:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/48#discussion_r822170959
##########
File path:
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/JobReconciler.java
##########
@@ -169,16 +189,24 @@ private void printCancelLogs(UpgradeMode upgradeMode,
String name) {
}
}
- private Optional<String> cancelJob(
+ private Optional<String> suspendJob(
FlinkDeployment flinkApp, UpgradeMode upgradeMode, Configuration
effectiveConfig)
throws Exception {
- Optional<String> savepointOpt =
- flinkService.cancelJob(
-
JobID.fromHexString(flinkApp.getStatus().getJobStatus().getJobId()),
- upgradeMode,
- effectiveConfig);
+
+ Optional<String> savepointOpt = Optional.empty();
+ if (upgradeMode == UpgradeMode.STATELESS) {
+ shutdown(flinkApp, effectiveConfig);
+ } else {
+ String jobIdString =
flinkApp.getStatus().getJobStatus().getJobId();
+ savepointOpt =
+ flinkService.cancelJob(
+ jobIdString != null ?
JobID.fromHexString(jobIdString) : null,
+ upgradeMode,
+ effectiveConfig);
+ }
+
JobStatus jobStatus = flinkApp.getStatus().getJobStatus();
- jobStatus.setState("suspended");
+ jobStatus.setState("SUSPENDED");
Review comment:
Could this replace "SUSPENDED" with `JobState.SUSPENDED.name()`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]