dawidwys commented on a change in pull request #10194: [FLINK-14758] Add 
Executor-related interfaces and executor discovery.
URL: https://github.com/apache/flink/pull/10194#discussion_r346351797
 
 

 ##########
 File path: 
flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java
 ##########
 @@ -761,7 +784,33 @@ public JobExecutionResult execute() throws Exception {
         * @return The result of the job execution, containing elapsed time and 
accumulators.
         * @throws Exception Thrown, if the program executions fails.
         */
-       public abstract JobExecutionResult execute(String jobName) throws 
Exception;
+       public JobExecutionResult execute(String jobName) throws Exception {
+               if (configuration.get(DeploymentOptions.TARGET) == null) {
+                       throw new RuntimeException("No execution.target 
specified in your configuration file.");
+               }
+
+               consolidateParallelismDefinitionsInConfiguration();
+
+               final Plan plan = createProgramPlan(jobName);
+               final ExecutorFactory executorFactory =
+                               
executorServiceLoader.getExecutorFactory(configuration);
+
+               final Executor executor = 
executorFactory.getExecutor(configuration);
+               lastJobExecutionResult = executor.execute(plan, configuration);
+               return lastJobExecutionResult;
+       }
+
+       private void consolidateParallelismDefinitionsInConfiguration() {
+               final int execParallelism = getParallelism();
+               if (execParallelism == ExecutionConfig.PARALLELISM_DEFAULT) {
 
 Review comment:
   Shouldn't it be the other way round? That if the parallelism is not set in 
the `ExecutionConfig`, but set in the `Configuration` than we should update the 
`ExecutionConfig` with that value?
   
   As far as I understand the parallelism setting, it is needed in the 
StreamGraph and Executors should not be bothered with it.

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

Reply via email to