tillrohrmann commented on a change in pull request #13217:
URL: https://github.com/apache/flink/pull/13217#discussion_r475554941



##########
File path: flink-clients/src/main/java/org/apache/flink/client/ClientUtils.java
##########
@@ -111,4 +122,41 @@ public static void executeProgram(
                        
Thread.currentThread().setContextClassLoader(contextClassLoader);
                }
        }
+
+       /**
+        * This method blocks until the job status is not INITIALIZING anymore.
+        * If the job is FAILED, it throws an CompletionException with the 
failure cause.
+        * @param jobStatusSupplier supplier returning the job status.
+        */
+       public static void waitUntilJobInitializationFinished(
+               SupplierWithException<JobStatus, Exception> jobStatusSupplier,
+               SupplierWithException<JobResult, Exception> jobResultSupplier
+               ) throws CompletionException {

Review comment:
       I'd say let's go with c) Throw a properly defined exception which 
signals what went wrong and let the caller be responsible for wrapping it into 
the right format. The latter should not be the responsibility of this method 
which already does enough.




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


Reply via email to