kl0u 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_r320887835
##########
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:
Yes, I fixed it. For some reason `flink-table` was excluded from my IDE and
I did not see the failure locally.
----------------------------------------------------------------
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