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_r320792153
 
 

 ##########
 File path: 
flink-clients/src/main/java/org/apache/flink/client/RemoteExecutor.java
 ##########
 @@ -178,49 +127,30 @@ public boolean isRunning() {
 
        @Override
        public JobExecutionResult executePlan(Plan plan) throws Exception {
-               if (plan == null) {
-                       throw new IllegalArgumentException("The plan may not be 
null.");
-               }
+               checkNotNull(plan);
 
                JobWithJars p = new JobWithJars(plan, this.jarFiles, 
this.globalClasspaths);
                return executePlanWithJars(p);
        }
 
-       public JobExecutionResult executePlanWithJars(JobWithJars program) 
throws Exception {
-               if (program == null) {
-                       throw new IllegalArgumentException("The job may not be 
null.");
-               }
-
-               synchronized (this.lock) {
-                       // check if we start a session dedicated for this 
execution
-                       final boolean shutDownAtEnd;
-
-                       if (client == null) {
-                               shutDownAtEnd = true;
-                               // start the executor for us
-                               start();
-                       }
-                       else {
-                               // we use the existing session
-                               shutDownAtEnd = false;
-                       }
+       private JobExecutionResult executePlanWithJars(JobWithJars program) 
throws Exception {
+               checkNotNull(program);
 
-                       try {
-                               return client.run(program, 
defaultParallelism).getJobExecutionResult();
-                       }
-                       finally {
-                               if (shutDownAtEnd) {
-                                       stop();
-                               }
+               ClusterClient<?>  client = null;
+               try {
+                       client = startClusterClient();
+                       return client.run(program, 
defaultParallelism).getJobExecutionResult();
+               } finally {
+                       if (client != null) {
+                               stopClusterClient(client);
 
 Review comment:
   I think the latest CI fails on uncompleted refactor
   
   ```
   12:40:29.667 [ERROR] 
/home/travis/build/flink-ci/flink/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ProgramDeployer.java:[134,54]
 cannot find symbol
     symbol:   method shutdown()
     location: variable clusterClient of type 
org.apache.flink.client.program.ClusterClient<T>
   12:40:29.668 [ERROR] 
/home/travis/build/flink-ci/flink/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/ProgramDeployer.java:[175,54]
 cannot find symbol
     symbol:   method shutdown()
     location: variable clusterClient of type 
org.apache.flink.client.program.ClusterClient<T>
   12:40:29.669 [ERROR] 
/home/travis/build/flink-ci/flink/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java:[434,62]
 cannot find symbol
     symbol:   method shutdown()
     location: variable clusterClient of type 
org.apache.flink.client.program.ClusterClient<T>
   ```

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