TisonKun commented on a change in pull request #9607: [FLINK-13946] Remove job 
session related code from ExecutionEnvironment
URL: https://github.com/apache/flink/pull/9607#discussion_r320674471
 
 

 ##########
 File path: 
flink-java/src/main/java/org/apache/flink/api/java/LocalEnvironment.java
 ##########
 @@ -71,150 +63,34 @@ public LocalEnvironment(Configuration config) {
                                        "The LocalEnvironment cannot be 
instantiated when running in a pre-defined context " +
                                                        "(such as Command Line 
Client, Scala Shell, or TestEnvironment)");
                }
-               this.configuration = config == null ? new Configuration() : 
config;
+               this.configuration = checkNotNull(config);
        }
 
        // 
--------------------------------------------------------------------------------------------
 
+       // TODO: 31.08.19 make sure that start and stop are called in the 
execute.
+       // the other place would be here, but this can complicate code, as the
+       // lifecycle management would be outside the executor itself.
+
        @Override
        public JobExecutionResult execute(String jobName) throws Exception {
-               if (executor == null) {
-                       startNewSession();
-               }
-
-               Plan p = createProgramPlan(jobName);
+               final Plan p = createProgramPlan(jobName);
 
-               // Session management is disabled, revert this commit to enable
-               //p.setJobId(jobID);
-               //p.setSessionTimeout(sessionTimeout);
-
-               JobExecutionResult result = executor.executePlan(p);
-
-               this.lastJobExecutionResult = result;
-               return result;
+               // TODO: 31.08.19 make the executor autocloseable
 
 Review comment:
   Another followup could be whether we unify stream & batch PlanExecutor or 
both inline it, given that in `PlanExecutor` can be only used in batch case and 
`RemoteStreamEnvironment` just inline the execution.
   
   In the context of client APIs refactoring it seems to finally have one env 
thus I'm afraid more works to `PlanExecutor` will be in vain.

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