From 2e0ee12e8d117510f3b27bdfa3fcb7fa6225eeca Mon Sep 17 00:00:00 2001 From: vainhope <845869847@qq.com> Date: Wed, 6 Mar 2024 19:25:18 +0800 Subject: [PATCH] [issue_1157][taier-scheduler] fix DataX sqlText replace #1157 --- .../taier/scheduler/service/DataxService.java | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/taier-scheduler/src/main/java/com/dtstack/taier/scheduler/service/DataxService.java b/taier-scheduler/src/main/java/com/dtstack/taier/scheduler/service/DataxService.java index 40bb0be5bf..15ff8235f5 100644 --- a/taier-scheduler/src/main/java/com/dtstack/taier/scheduler/service/DataxService.java +++ b/taier-scheduler/src/main/java/com/dtstack/taier/scheduler/service/DataxService.java @@ -1,21 +1,14 @@ package com.dtstack.taier.scheduler.service; import com.alibaba.fastjson.JSONObject; -import com.dtstack.taier.common.enums.EScheduleJobType; -import com.dtstack.taier.common.env.EnvironmentContext; import com.dtstack.taier.common.exception.TaierDefineException; -import com.dtstack.taier.common.util.TaskParamsUtils; import com.dtstack.taier.dao.domain.ScheduleJob; import com.dtstack.taier.dao.domain.ScheduleTaskShade; import com.dtstack.taier.dao.dto.ScheduleTaskParamShade; import com.dtstack.taier.pluginapi.constrant.ConfigConstant; -import com.dtstack.taier.pluginapi.enums.EDeployMode; import com.dtstack.taier.scheduler.PluginWrapper; -import com.dtstack.taier.scheduler.executor.DatasourceOperator; import com.dtstack.taier.scheduler.server.pipeline.JobParamReplace; import com.dtstack.taier.scheduler.utils.CreateJsonFileUtil; -import com.dtstack.taier.scheduler.utils.FileUtil; -import com.dtstack.taier.scheduler.utils.ScriptUtil; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; @@ -35,15 +28,6 @@ @Service public class DataxService { - @Autowired - private ClusterService clusterService; - - @Autowired - private EnvironmentContext environmentContext; - - @Autowired - private DatasourceOperator datasourceOperator; - @Autowired private PluginWrapper pluginWrapper; @@ -74,19 +58,6 @@ public void handDataxParams(Map actionParam, ScheduleTaskShade t } dealDataxExeParams(actionParam, task, scheduleJob, sqlText); } - /** - * 将脚本上传到 hdfs - * - * @param sqlText - * @param task - * @param scheduleJob - * @return - */ - private String uploadToHdfs(String sqlText, ScheduleTaskShade task, ScheduleJob scheduleJob) { - JSONObject pluginInfo = clusterService.pluginInfoJSON(task.getTenantId(), task.getTaskType(), null, null, null); - String hdfsPath = environmentContext.getHdfsTaskPath() + (FileUtil.getUploadFileName(task.getTaskType(), scheduleJob.getJobId())); - return datasourceOperator.uploadToHdfs(pluginInfo, task.getTenantId(), sqlText, hdfsPath); - } private void dealDataxExeParams(Map actionParam, ScheduleTaskShade task, ScheduleJob scheduleJob, String sqlText) throws IOException { @@ -112,7 +83,7 @@ private void dealDataxExeParams(Map actionParam, ScheduleTaskSha throw new TaierDefineException("datax.local.path is null"); } //生成datax的json文件 - String taskTempPath = CreateJsonFileUtil.createJsonFile(task.getSqlText(), tempPath, task.getName()); + String taskTempPath = CreateJsonFileUtil.createJsonFile(sqlText, tempPath, task.getName()); if (StringUtils.isBlank(taskTempPath)) { throw new TaierDefineException("创建datax.json文件失败"); }