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

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

Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5207#discussion_r161010273
  
    --- Diff: 
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
 ---
    @@ -148,6 +181,39 @@ private void submitJob(JobGraph jobGraph) throws 
JobSubmissionException {
                }
        }
     
    +   private JobExecutionResult waitForJobExecutionResult(
    +                   final JobID jobId) throws ProgramInvocationException {
    +
    +           final JobMessageParameters messageParameters = new 
JobMessageParameters();
    +           messageParameters.jobPathParameter.resolve(jobId);
    +           JobExecutionResultResponseBody jobExecutionResultResponseBody;
    +           try {
    +                   long attempt = 0;
    +                   do {
    +                           final 
CompletableFuture<JobExecutionResultResponseBody> responseFuture =
    +                                   restClient.sendRequest(
    +                                           
restClusterClientConfiguration.getRestServerAddress(),
    +                                           
restClusterClientConfiguration.getRestServerPort(),
    +                                           
JobExecutionResultHeaders.getInstance(),
    +                                           messageParameters);
    +                           jobExecutionResultResponseBody = 
responseFuture.get(timeout.toMillis(), TimeUnit.MILLISECONDS);
    +                           Thread.sleep(waitStrategy.sleepTime(attempt));
    +                           attempt++;
    +                   }
    +                   while 
(jobExecutionResultResponseBody.getStatus().getStatusId() != 
QueueStatus.StatusId.COMPLETED);
    --- End diff --
    
    Alright, then let's do it there.


> Retrieve ExecutionResult by REST polling
> ----------------------------------------
>
>                 Key: FLINK-8299
>                 URL: https://issues.apache.org/jira/browse/FLINK-8299
>             Project: Flink
>          Issue Type: Sub-task
>          Components: REST
>    Affects Versions: 1.5.0
>            Reporter: Gary Yao
>            Assignee: Gary Yao
>            Priority: Blocker
>              Labels: flip-6
>             Fix For: 1.5.0
>
>
> Retrieve the {{ExecutionResult}} from a finished Flink job via the 
> {{RestClusterClient}}.



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

Reply via email to