Github user GJL commented on a diff in the pull request: https://github.com/apache/flink/pull/5437#discussion_r168459950 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java --- @@ -402,6 +403,24 @@ public void start() throws Exception { } } + @Override + public CompletableFuture<JobResult> requestJobResult(JobID jobId, Time timeout) { + final JobManagerRunner jobManagerRunner = jobManagerRunners.get(jobId); + + if (jobManagerRunner == null) { + final ArchivedExecutionGraph archivedExecutionGraph = archivedExecutionGraphStore.get(jobId); + + if (archivedExecutionGraph == null) { + return FutureUtils.completedExceptionally(new FlinkJobNotFoundException(jobId)); + } else { + return CompletableFuture.completedFuture(JobResult.createFrom(archivedExecutionGraph)); + } + } else { + return jobManagerRunner.getResultFuture().thenApply( --- End diff -- nit: can be rewritten as `return jobManagerRunner.getResultFuture().thenApply(JobResult::createFrom);`
---