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 19:54:05 UTC

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

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



##########
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:
       Yes I think we could have a Savepoint/SavepointInfo object in the `lastSavepoint` field of the jobstatus to add metadata like creation time that could be valuable




-- 
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