|
32 | 32 | import com.streamxhub.streamx.common.enums.DevelopmentMode;
|
33 | 33 | import com.streamxhub.streamx.common.enums.ExecutionMode;
|
34 | 34 | import com.streamxhub.streamx.common.enums.ResolveOrder;
|
| 35 | +import com.streamxhub.streamx.common.enums.StorageType; |
| 36 | +import com.streamxhub.streamx.common.fs.HdfsOperator; |
35 | 37 | import com.streamxhub.streamx.common.util.DeflaterUtils;
|
36 | 38 | import com.streamxhub.streamx.common.util.ExceptionUtils;
|
37 | 39 | import com.streamxhub.streamx.common.util.ThreadUtils;
|
@@ -425,6 +427,12 @@ private void removeApp(Application application) {
|
425 | 427 | Long appId = application.getId();
|
426 | 428 | removeById(appId);
|
427 | 429 | application.getFsOperator().delete(application.getWorkspace().APP_WORKSPACE().concat("/").concat(appId.toString()));
|
| 430 | + try { |
| 431 | + //曾经设置过yarn-application类型,尝试删除,不留后患. |
| 432 | + HdfsOperator.delete(Workspace.of(StorageType.HDFS).APP_WORKSPACE().concat("/").concat(appId.toString())); |
| 433 | + } catch (Exception e) { |
| 434 | + //skip |
| 435 | + } |
428 | 436 | }
|
429 | 437 |
|
430 | 438 | @Override
|
@@ -812,6 +820,7 @@ public Application getApp(Application appParam) {
|
812 | 820 | }
|
813 | 821 | }
|
814 | 822 | }
|
| 823 | + |
815 | 824 | if (ExecutionMode.YARN_SESSION.equals(application.getExecutionModeEnum())) {
|
816 | 825 | if (!application.getHotParamsMap().isEmpty()) {
|
817 | 826 | if (application.getHotParamsMap().containsKey(ConfigConst.KEY_YARN_APP_ID())) {
|
@@ -896,7 +905,7 @@ public void cancel(Application appParam) {
|
896 | 905 | String yarnQueue = (String) application.getHotParamsMap().get(ConfigConst.KEY_YARN_APP_QUEUE());
|
897 | 906 | optionMap.put(ConfigConst.KEY_YARN_APP_QUEUE(), yarnQueue);
|
898 | 907 |
|
899 |
| - if (!application.getHotParamsMap().isEmpty()) { |
| 908 | + if (ExecutionMode.YARN_SESSION.equals(application.getExecutionModeEnum())) { |
900 | 909 | String yarnSessionClusterId = (String) application.getHotParamsMap().get(ConfigConst.KEY_YARN_APP_ID());
|
901 | 910 | assert yarnSessionClusterId != null;
|
902 | 911 | extraParameter.put(ConfigConst.KEY_YARN_APP_ID(), yarnSessionClusterId);
|
@@ -1072,6 +1081,12 @@ public boolean start(Application appParam, boolean auto) throws Exception {
|
1072 | 1081 | extraParameter.put(RestOptions.PORT.key(), activeAddress.getPort());
|
1073 | 1082 | }
|
1074 | 1083 |
|
| 1084 | + if (ExecutionMode.YARN_SESSION.equals(application.getExecutionModeEnum())) { |
| 1085 | + String yarnSessionClusterId = (String) application.getHotParamsMap().get(ConfigConst.KEY_YARN_APP_ID()); |
| 1086 | + assert yarnSessionClusterId != null; |
| 1087 | + extraParameter.put(ConfigConst.KEY_YARN_APP_ID(), yarnSessionClusterId); |
| 1088 | + } |
| 1089 | + |
1075 | 1090 | if (application.isFlinkSqlJob()) {
|
1076 | 1091 | FlinkSql flinkSql = flinkSqlService.getEffective(application.getId(), false);
|
1077 | 1092 | extraParameter.put(ConfigConst.KEY_FLINK_SQL(null), flinkSql.getSql());
|
|
0 commit comments