[ 
https://issues.apache.org/jira/browse/FLINK-7791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200297#comment-16200297
 ] 

ASF GitHub Bot commented on FLINK-7791:
---------------------------------------

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.


> Integrate LIST command into REST client
> ---------------------------------------
>
>                 Key: FLINK-7791
>                 URL: https://issues.apache.org/jira/browse/FLINK-7791
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Client, REST
>    Affects Versions: 1.4.0
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>             Fix For: 1.4.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to