Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/4802#discussion_r144011359
--- Diff:
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
---
@@ -192,6 +196,18 @@ public String cancelWithSavepoint(JobID jobId,
@Nullable String savepointDirecto
.thenApply(response -> response.location);
}
+ @Override
+ public CompletableFuture<Collection<JobDetails>> listJobs() throws
Exception {
+ CurrentJobsOverviewHandlerHeaders headers =
CurrentJobsOverviewHandlerHeaders.getInstance();
+ CompletableFuture<MultipleJobsDetails> jobDetailsFuture =
restClient.sendRequest(
+ restClusterClientConfiguration.getRestServerAddress(),
+ restClusterClientConfiguration.getRestServerPort(),
+ headers
+ );
+ return jobDetailsFuture
+ .thenApply(MultipleJobsDetails::getRunning);
--- End diff --
we don't _have_ to, as the LIST command only cares about running jobs, but
we certainly could just return all. The CLI is filtering the jobs anyway.
---