Skip to content

Commit 388e7f8

Browse files
committed
deal minicluster
1 parent c27194e commit 388e7f8

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

core/src/main/java/com/dtstack/flink/sql/environment/MyLocalStreamEnvironment.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,13 @@ public JobExecutionResult execute(String jobName) throws Exception {
113113
LOG.info("Running job on local embedded Flink mini cluster");
114114
}
115115

116-
MiniCluster exec = null;
117-
try {
118-
exec = new MiniCluster(configBuilder.build());
116+
try (MiniCluster exec = new MiniCluster(configBuilder.build());) {
119117
exec.start();
120-
return exec.executeJobBlocking(jobGraph);
121-
} finally {
118+
JobExecutionResult jobExecutionResult = exec.executeJobBlocking(jobGraph);
122119
transformations.clear();
123-
if (null != exec) {
124-
exec.closeAsync();
125-
}
120+
return jobExecutionResult;
121+
} catch (Exception e) {
122+
throw new RuntimeException(e);
126123
}
127124
}
128125
}

0 commit comments

Comments
 (0)