kl0u commented on a change in pull request #10311: [FLINK-14762][client] Enrich
JobClient API
URL: https://github.com/apache/flink/pull/10311#discussion_r351171554
##########
File path: flink-clients/src/main/java/org/apache/flink/client/ClientUtils.java
##########
@@ -125,23 +119,15 @@ public static JobExecutionResult
submitJobAndWaitForResult(
checkNotNull(jobGraph);
checkNotNull(classLoader);
- JobResult jobResult;
-
- try {
- jobResult = client
- .submitJob(jobGraph)
- .thenApply(JobSubmissionResult::getJobID)
- .thenCompose(client::requestJobResult)
- .get();
- } catch (InterruptedException | ExecutionException e) {
- ExceptionUtils.checkInterrupted(e);
- throw new ProgramInvocationException("Could not run
job", jobGraph.getJobID(), e);
- }
-
- try {
- return jobResult.toJobExecutionResult(classLoader);
- } catch (JobExecutionException | IOException |
ClassNotFoundException e) {
- throw new ProgramInvocationException("Job failed",
jobGraph.getJobID(), e);
+ try (JobClient jobClient = client.submitJob(jobGraph).join()){
Review comment:
I see.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services