diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java index c9e4ebf434..c9145bdcd5 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java @@ -67,20 +67,15 @@ public class LoggerUtils { * build job id * * @param affix Task Logger's prefix - * @param processDefId process define id * @param processInstId process instance id * @param taskId task id * @return task id format */ public static String buildTaskId(String affix, - int processDefId, int processInstId, int taskId) { // - [taskAppId=TASK_79_4084_15210] - return String.format(" - %s%s-%s-%s-%s]", TASK_APPID_LOG_FORMAT, affix, - processDefId, - processInstId, - taskId); + return String.format(" - %s%s-%s-%s]", TASK_APPID_LOG_FORMAT, affix, processInstId, taskId); } /** diff --git a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/LoggerUtilsTest.java b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/LoggerUtilsTest.java index 811dff5895..209e3a5f49 100644 --- a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/LoggerUtilsTest.java +++ b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/LoggerUtilsTest.java @@ -42,7 +42,7 @@ public class LoggerUtilsTest { @Test public void buildTaskId() { - String taskId = LoggerUtils.buildTaskId(LoggerUtils.TASK_LOGGER_INFO_PREFIX, 79, 4084, 15210); + String taskId = LoggerUtils.buildTaskId(LoggerUtils.TASK_LOGGER_INFO_PREFIX, 4084, 15210); Assert.assertEquals(" - [taskAppId=TASK-79-4084-15210]", taskId); } diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java index 00f2b9a91b..a2de601916 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java @@ -21,7 +21,6 @@ import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.Priority; import org.apache.dolphinscheduler.common.enums.TaskType; -import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.task.dependent.DependentParameters; import org.apache.dolphinscheduler.common.utils.JSONUtils; @@ -58,13 +57,6 @@ public class TaskInstance implements Serializable { */ private String taskType; - /** - * process definition id - * TODO delete - */ - @TableField(exist = false) - private int processDefinitionId; - /** * process instance id */ @@ -75,11 +67,6 @@ public class TaskInstance implements Serializable { */ private long taskCode; - /** - * process definition code - */ - private long processDefinitionCode; - /** * task defintion version */ @@ -91,13 +78,6 @@ public class TaskInstance implements Serializable { @TableField(exist = false) private String processInstanceName; - /** - * task json - * TODO delete - */ - @TableField(exist = false) - private String taskJson; - /** * state */ @@ -255,6 +235,7 @@ public class TaskInstance implements Serializable { /** * task params */ + @TableField(exist = false) private String taskParams; public void init(String host, Date startTime, String executePath) { @@ -311,14 +292,6 @@ public class TaskInstance implements Serializable { this.taskType = taskType; } - public int getProcessDefinitionId() { - return processDefinitionId; - } - - public void setProcessDefinitionId(int processDefinitionId) { - this.processDefinitionId = processDefinitionId; - } - public int getProcessInstanceId() { return processInstanceId; } @@ -327,14 +300,6 @@ public class TaskInstance implements Serializable { this.processInstanceId = processInstanceId; } - public String getTaskJson() { - return taskJson; - } - - public void setTaskJson(String taskJson) { - this.taskJson = taskJson; - } - public ExecutionStatus getState() { return state; } @@ -593,10 +558,8 @@ public class TaskInstance implements Serializable { + "id=" + id + ", name='" + name + '\'' + ", taskType='" + taskType + '\'' - + ", processDefinitionId=" + processDefinitionId + ", processInstanceId=" + processInstanceId + ", processInstanceName='" + processInstanceName + '\'' - + ", taskJson='" + taskJson + '\'' + ", state=" + state + ", firstSubmitTime=" + firstSubmitTime + ", submitTime=" + submitTime @@ -634,14 +597,6 @@ public class TaskInstance implements Serializable { this.taskCode = taskCode; } - public long getProcessDefinitionCode() { - return processDefinitionCode; - } - - public void setProcessDefinitionCode(long processDefinitionCode) { - this.processDefinitionCode = processDefinitionCode; - } - public int getTaskDefinitionVersion() { return taskDefinitionVersion; } diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.java index 833827bca3..898708e888 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.java @@ -51,12 +51,10 @@ public interface TaskInstanceMapper extends BaseMapper { TaskInstance queryByInstanceIdAndName(@Param("processInstanceId") int processInstanceId, @Param("name") String name); - Integer countTask( - @Param("projectCodes") Long[] projectCodes, + Integer countTask(@Param("projectCodes") Long[] projectCodes, @Param("taskIds") int[] taskIds); - List countTaskInstanceStateByUser( - @Param("startTime") Date startTime, + List countTaskInstanceStateByUser(@Param("startTime") Date startTime, @Param("endTime") Date endTime, @Param("projectCodes") Long[] projectCodes); diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml index defccace58..96ec4bb3eb 100644 --- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml +++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml @@ -19,13 +19,13 @@ - id, name, task_type, process_instance_id, task_code, task_definition_version, process_definition_code, state, submit_time, + id, name, task_type, process_instance_id, task_code, task_definition_version, state, submit_time, start_time, end_time, host, execute_path, log_path, alert_flag, retry_times, pid, app_link, flag, retry_interval, max_retry_times, task_instance_priority, worker_group, executor_id, first_submit_time, delay_time, var_pool - ${alias}.id, ${alias}.name, ${alias}.task_type, ${alias}.task_code, ${alias}.task_definition_version, ${alias}.process_definition_code, ${alias}.process_instance_id, ${alias}.state, ${alias}.submit_time, + ${alias}.id, ${alias}.name, ${alias}.task_type, ${alias}.task_code, ${alias}.task_definition_version, ${alias}.process_instance_id, ${alias}.state, ${alias}.submit_time, ${alias}.start_time, ${alias}.end_time, ${alias}.host, ${alias}.execute_path, ${alias}.log_path, ${alias}.alert_flag, ${alias}.retry_times, ${alias}.pid, ${alias}.app_link, ${alias}.flag, ${alias}.retry_interval, ${alias}.max_retry_times, ${alias}.task_instance_priority, ${alias}.worker_group, ${alias}.executor_id, ${alias}.first_submit_time, ${alias}.delay_time, ${alias}.var_pool @@ -72,7 +72,7 @@