zentol commented on a change in pull request #17474:
URL: https://github.com/apache/flink/pull/17474#discussion_r728946703



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java
##########
@@ -683,19 +689,79 @@ JobManagerRunner createJobManagerRunner(JobGraph 
jobGraph, long initializationTi
                 jobID, gateway -> gateway.triggerCheckpoint(timeout));
     }
 
+    private final CompletedOperationCache<AsynchronousJobOperationKey, String>
+            savepointOperationCache = new CompletedOperationCache<>();
+
     @Override
-    public CompletableFuture<String> triggerSavepoint(
+    // TODO: this needs to return a future which gets complete once the 
savepoint is actually
+    // TODO: triggered; if complete reutrn 204 ACCEPTED, on error handle them
+    // TODO: / we may need a separate versions of this method for
+    // TODO: the REST API / (job client / minicluster), which _may_ need to 
wired down to the
+    // TODO: JobMaster
+    public CompletableFuture<Acknowledge> triggerSavepoint(
             final JobID jobId,
             final String targetDirectory,
             final boolean cancelJob,
+            TriggerId operationId,
             final Time timeout) {
 
+        AsynchronousJobOperationKey operationKey =
+                AsynchronousJobOperationKey.of(operationId, jobId);
+        Optional<OperationResult<String>> existingTriggerResultOptional =
+                savepointOperationCache.get(operationKey);
+
+        if (existingTriggerResultOptional.isEmpty()) {

Review comment:
       The only thing that should remain in the dispatcher is a check against 
said component for ongoing operations, and then the triggering of the savepoint.




-- 
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: issues-unsubscr...@flink.apache.org

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


Reply via email to