0%

Flink本地编译获取plan

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//
org.apache.flink.streaming.api.environment.StreamExplainEnvironment
//
try {
streamExplainEnvironment.setAsContext();

try {
// do something.
streamExplainEnvironment.execute("");
} catch (InvocationTargetException e) {
Throwable throwable = e.getCause();
while (throwable != null) {
if (throwable instanceof ProgramExecutedException) {
StreamGraph streamGraph = streamExplainEnvironment.getPlan();
}

throwable = throwable.getCause();
}

throw e.getTargetException();
}
} finally {
streamExplainEnvironment.unsetAsContext();
}