kl0u commented on a change in pull request #9972: [FLINK-14496][client] Exclude
detach flag from ClusterClient
URL: https://github.com/apache/flink/pull/9972#discussion_r341102714
##########
File path: flink-clients/src/main/java/org/apache/flink/client/ClientUtils.java
##########
@@ -95,15 +100,55 @@ public static ClassLoader
buildUserCodeClassLoader(List<URL> jars, List<URL> cla
return FlinkUserCodeClassLoaders.parentFirst(urls, parent);
}
+ public static JobSubmissionResult submitJob(
+ ClusterClient<?> client,
+ JobGraph jobGraph) throws ProgramInvocationException {
+ try {
+ return client
+ .submitJob(jobGraph)
+ .thenApply(JobSubmissionResult::getJobID)
+ .thenApply(DetachedJobExecutionResult::new)
+ .get();
+ } catch (InterruptedException | ExecutionException e) {
+ ExceptionUtils.checkInterrupted(e);
+ throw new ProgramInvocationException("Could not run job
in detached mode.", jobGraph.getJobID(), e);
+ }
+ }
+
+ public static JobExecutionResult submitJobAndWaitForResult(
+ ClusterClient<?> client,
Review comment:
Please indent the arguments by one more tab. Although not enforced
everywhere, the arguments should be normally one more tab to the inside
compared to the body of the method. This makes the code more readable.
----------------------------------------------------------------
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