Unverified Commit 209ab7df authored by 高岩's avatar 高岩 Committed by GitHub

bug fix k8s sql application savepoint failed (#1315)

* bug fix k8s application savepoint failed * add some comment Co-authored-by: steve <woai1998>
parent 03c86bcd
......@@ -752,20 +752,18 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
JobConfig jobConfig = new JobConfig();
jobConfig.setAddress(cluster.getJobManagerHost());
jobConfig.setType(cluster.getType());
Task task = this.getTaskInfoById(cluster.getTaskId());
if (GatewayType.KUBERNETES_APPLICATION.equalsValue(cluster.getType())) {
Statement statement = statementService.getById(cluster.getTaskId());
Map<String, Object> clusterConfiguration =
clusterConfigurationService.getGatewayConfig(cluster.getClusterConfigurationId());
Map<String, Object> gatewayConfig = JSONUtil.toMap(statement.getStatement(), String.class, Object.class);
gatewayConfig.putAll(clusterConfiguration);
jobConfig.buildGatewayConfig(gatewayConfig);
jobConfig.getGatewayConfig().getClusterConfig().setAppId(cluster.getName());
useGateway = true;
}
if (Asserts.isNotNull(cluster.getClusterConfigurationId())) {
Map<String, Object> gatewayConfig =
clusterConfigurationService.getGatewayConfig(cluster.getClusterConfigurationId());
// 如果是k8s application 模式,且不是sql任务,则需要补齐statement 内的自定义配置
if (Dialect.KUBERNETES_APPLICATION.equalsVal(task.getDialect())) {
Statement statement = statementService.getById(cluster.getTaskId());
Map<String, Object> statementConfig =
JSONUtil.toMap(statement.getStatement(), String.class, Object.class);
gatewayConfig.putAll(statementConfig);
}
jobConfig.buildGatewayConfig(gatewayConfig);
jobConfig.getGatewayConfig().getClusterConfig().setAppId(cluster.getName());
useGateway = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment