[
https://issues.apache.org/jira/browse/FLINK-8778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16378326#comment-16378326
]
ASF GitHub Bot commented on FLINK-8778:
---------------------------------------
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/5579#discussion_r170861537
--- Diff:
flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
---
@@ -255,14 +258,24 @@ protected JobSubmissionResult submitJob(JobGraph
jobGraph, ClassLoader classLoad
}
}
- /**
- * Requests the {@link JobResult} for the given {@link JobID}. The
method retries multiple
- * times to poll the {@link JobResult} before giving up.
- *
- * @param jobId specifying the job for which to retrieve the {@link
JobResult}
- * @return Future which is completed with the {@link JobResult} once
the job has completed or
- * with a failure if the {@link JobResult} could not be retrieved.
- */
+ @Override
+ public CompletableFuture<JobStatus> getJobStatus(JobID jobId) {
+ JobDetailsHeaders detailsHeaders =
JobDetailsHeaders.getInstance();
+ final JobMessageParameters params = new JobMessageParameters();
+ params.jobPathParameter.resolve(jobId);
+
+ CompletableFuture<JobDetailsInfo> responseFuture =
sendRequest(detailsHeaders, params);
+
+ return responseFuture.thenApply((JobDetailsInfo jobDetailsInfo)
-> {
+ if (jobDetailsInfo != null) {
+ return jobDetailsInfo.getJobStatus();
+ }
+
+ throw new RuntimeException("Unknown JobStatus.");
--- End diff --
Let's not throw unchecked exceptions, especially no runtime exception if
the only reason is that the user requested a wrong `JobID`.
> Migrate queryable state ITCases to use MiniClusterResource
> ----------------------------------------------------------
>
> Key: FLINK-8778
> URL: https://issues.apache.org/jira/browse/FLINK-8778
> Project: Flink
> Issue Type: Sub-task
> Components: Tests
> Reporter: Aljoscha Krettek
> Assignee: Aljoscha Krettek
> Priority: Blocker
> Fix For: 1.5.0
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)