Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/4802#discussion_r144004816
--- Diff:
flink-clients/src/main/java/org/apache/flink/client/CliFrontend.java ---
@@ -420,89 +420,72 @@ protected int list(String[] args) {
}
try {
- ActorGateway jobManagerGateway =
getJobManagerGateway(options);
-
- LOG.info("Connecting to JobManager to retrieve list of
jobs");
- Future<Object> response = jobManagerGateway.ask(
-
JobManagerMessages.getRequestRunningJobsStatus(),
- clientTimeout);
+ CustomCommandLine<?> activeCommandLine =
getActiveCustomCommandLine(options.getCommandLine());
+ ClusterClient client =
activeCommandLine.retrieveCluster(options.getCommandLine(), config,
configurationDirectory);
- Object result;
+ Collection<JobDetails> jobDetails;
try {
- result = Await.result(response, clientTimeout);
- }
- catch (Exception e) {
- throw new Exception("Could not retrieve running
jobs from the JobManager.", e);
+ CompletableFuture<Collection<JobDetails>>
jobDetailsFuture = client.listJobs();
--- End diff --
Should we hide the fact that we are retrieving `JobDetails` internally and
still only return a `Collection<JobStatus>`? The reason is that in the future
we might change how we retrieve the job ids, job names plus their state.
---