XComp commented on code in PR #19567:
URL: https://github.com/apache/flink/pull/19567#discussion_r860671795


##########
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java:
##########
@@ -659,14 +661,36 @@ private CompletableFuture<CleanupJobState> 
handleJobManagerRunnerResult(
         return 
jobReachedTerminalState(jobManagerRunnerResult.getExecutionGraphInfo());
     }
 
-    enum CleanupJobState {
-        LOCAL,
-        GLOBAL
+    private static class CleanupJobStateWithJobStatusIfGlobal {
+
+        private static final CleanupJobStateWithJobStatusIfGlobal LOCAL =
+                new CleanupJobStateWithJobStatusIfGlobal(null);

Review Comment:
   That's a good point. That keeps it consistent. Thanks for questioning that 
approach... 👍 



##########
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java:
##########
@@ -659,14 +661,36 @@ private CompletableFuture<CleanupJobState> 
handleJobManagerRunnerResult(
         return 
jobReachedTerminalState(jobManagerRunnerResult.getExecutionGraphInfo());
     }
 
-    enum CleanupJobState {
-        LOCAL,
-        GLOBAL
+    private static class CleanupJobStateWithJobStatusIfGlobal {
+
+        private static final CleanupJobStateWithJobStatusIfGlobal LOCAL =
+                new CleanupJobStateWithJobStatusIfGlobal(null);
+
+        @Nullable private final JobStatus jobStatus;
+
+        public static CleanupJobStateWithJobStatusIfGlobal 
globalCleanup(JobStatus jobStatus) {

Review Comment:
   hm, you're right. the not-null check should be moved into this method to 
make it fail early.



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

Reply via email to