flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-8299) Retrieve ExecutionResult by REST polling
Date Mon, 08 Jan 2018 12:26:00 GMT

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

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_r160125031
  
    --- 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 --
    
    `getStatus().getStatusId()` looks not so nice tbh.


> 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)

Mime
View raw message