flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #4802: [FLINK-7791] [REST][client] Integrate LIST command...
Date Wed, 11 Oct 2017 13:50:19 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4802#discussion_r144016836
  
    --- 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 --
    
    Even if we change how we retrieve it we can still wrap them in a JobDetails object; it
doesn't necessarily leak to the outside how we retrieve them. Given that the CLI requires
the job id, job name, start/end timestamp and job status we aren't saving much by creating
a slimmed down JobDetails class.


---

Mime
View raw message