[ https://issues.apache.org/jira/browse/FLINK-7638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16174659#comment-16174659 ]
ASF GitHub Bot commented on FLINK-7638: --------------------------------------- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/4688#discussion_r140226502 --- 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 -- `FutureUtils.combineAll` returns a `Arrays.ArrayList`. This type is directly backed by the provided array. When calling `Arrays.ArrayList#toArray`, this array will be copied. Thus, I can change `MultipleJobsDetails` to store the individual `JobDetails` as a list. Then there should be no copy involved. > 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)