You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/09/04 09:58:25 UTC

[GitHub] [flink] TisonKun commented on a change in pull request #9607: [FLINK-13946] Remove job session related code from ExecutionEnvironment

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_r320671195
 
 

 ##########
 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();
 
 Review comment:
   inline `startClusterClient` and `stopClusterClient` make more sense to me.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services