You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by GitBox <gi...@apache.org> on 2022/03/03 12:51:03 UTC

[GitHub] [flink-kubernetes-operator] SteNicholas commented on a change in pull request #38: [FLINK-26181] Support manual savepoint triggering in the operator

SteNicholas commented on a change in pull request #38:
URL: https://github.com/apache/flink-kubernetes-operator/pull/38#discussion_r818624385



##########
File path: flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/service/FlinkService.java
##########
@@ -168,4 +169,18 @@ public void stopSessionCluster(
         FlinkUtils.deleteCluster(deployment, kubernetesClient, deleteHaData);
         FlinkUtils.waitForClusterShutdown(kubernetesClient, conf);
     }
+
+    public void triggerSavepoint(FlinkDeployment deployment, Configuration conf) throws Exception {
+        LOG.info("Triggering savepoint on " + deployment.getMetadata().getName());
+        try (ClusterClient<String> clusterClient = getClusterClient(conf)) {
+            CompletableFuture<String> result =
+                    clusterClient.triggerSavepoint(
+                            JobID.fromHexString(deployment.getStatus().getJobStatus().getJobId()),
+                            null);
+            deployment.getStatus().getJobStatus().setSavepointLocation(result.get());

Review comment:
       Does this need to check the result is valid?




-- 
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: commits-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org