[ https://issues.apache.org/jira/browse/FLINK-7638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16174506#comment-16174506 ]
ASF GitHub Bot commented on FLINK-7638: --------------------------------------- Github user tzulitai commented on a diff in the pull request: https://github.com/apache/flink/pull/4688#discussion_r140190681 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/Dispatcher.java --- @@ -258,6 +260,23 @@ public void start() throws Exception { 8)); } + @Override + public CompletableFuture<MultipleJobsDetails> requestJobDetails(Time timeout) { + final int numberJobsRunning = jobManagerRunners.size(); + + ArrayList<CompletableFuture<JobDetails>> individualJobDetails = new ArrayList<>(numberJobsRunning); + + for (JobManagerRunner jobManagerRunner : jobManagerRunners.values()) { + individualJobDetails.add(jobManagerRunner.getJobManagerGateway().requestJobDetails(timeout)); + } + + CompletableFuture<Collection<JobDetails>> combinedJobDetails = FutureUtils.combineAll(individualJobDetails); + + return combinedJobDetails.thenApply( + (Collection<JobDetails> jobDetails) -> + new MultipleJobsDetails(jobDetails.toArray(new JobDetails[numberJobsRunning]), null)); --- End diff -- Can we somehow lessen the array <-> collection conversions here? For example, I think in `FutureUtils.combineAll` the completed results were actually originally an array before they were returned as a collection, and then here we're converting it back to an array again. > Port CurrentJobsOverviewHandler to new REST endpoint > ---------------------------------------------------- > > Key: FLINK-7638 > URL: https://issues.apache.org/jira/browse/FLINK-7638 > Project: Flink > Issue Type: Sub-task > Components: REST, Webfrontend > Affects Versions: 1.4.0 > Reporter: Till Rohrmann > Assignee: Till Rohrmann > Priority: Minor > Labels: flip-6 > > Port the existing {{CurrentJobsOverviewHandler}} to the new REST endpoint. -- This message was sent by Atlassian JIRA (v6.4.14#64029)