diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessInstanceServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessInstanceServiceTest.java index 800f8bda1894..9fb4d830528d 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessInstanceServiceTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessInstanceServiceTest.java @@ -769,7 +769,6 @@ public void testViewGantt() throws Exception { processInstance.getProcessDefinitionCode(), processInstance.getProcessDefinitionVersion())).thenReturn(new ProcessDefinitionLog()); when(processInstanceMapper.queryDetailById(1)).thenReturn(processInstance); - when(taskInstanceMapper.queryByInstanceIdAndName(Mockito.anyInt(), Mockito.any())).thenReturn(taskInstance); DAG graph = new DAG<>(); for (long i = 1; i <= 7; ++i) { graph.addNode(i, new TaskNode()); 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 04e818f5c3ae..f80dac826c6e 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 @@ -39,23 +39,10 @@ */ public interface TaskInstanceMapper extends BaseMapper { - List queryTaskByProcessIdAndState(@Param("processInstanceId") Integer processInstanceId, - @Param("state") Integer state); - List findValidTaskListByProcessId(@Param("processInstanceId") Integer processInstanceId, @Param("flag") Flag flag, @Param("testFlag") int testFlag); - List queryByHostAndStatus(@Param("host") String host, - @Param("states") int[] stateArray); - - int setFailoverByHostAndStateArray(@Param("host") String host, - @Param("states") int[] stateArray, - @Param("destStatus") TaskExecutionStatus destStatus); - - TaskInstance queryByInstanceIdAndName(@Param("processInstanceId") int processInstanceId, - @Param("name") String name); - TaskInstance queryByInstanceIdAndCode(@Param("processInstanceId") int processInstanceId, @Param("taskCode") Long taskCode); @@ -66,9 +53,6 @@ TaskInstance queryByInstanceIdAndCode(@Param("processInstanceId") int processIns List queryByProcessInstanceIdsAndTaskCodes(@Param("processInstanceIds") List processInstanceIds, @Param("taskCodes") List taskCodes); - Integer countTask(@Param("projectCodes") Long[] projectCodes, - @Param("taskIds") int[] taskIds); - /** * Statistics task instance group by given project codes list by start time *

@@ -97,20 +81,6 @@ List countTaskInstanceStateByProjectIdsV2(@Param("startTime" @Param("endTime") Date endTime, @Param("projectIds") Set projectIds); - /** - * Statistics task instance group by given project codes list by submit time - *

- * We only need project codes to determine whether the task instance belongs to the user or not. - * - * @param startTime Statistics start time - * @param endTime Statistics end time - * @param projectCodes Project codes list to filter - * @return List of ExecuteStatusCount - */ - List countTaskInstanceStateByProjectCodesAndStatesBySubmitTime(@Param("startTime") Date startTime, - @Param("endTime") Date endTime, - @Param("projectCodes") Long[] projectCodes, - @Param("states") List states); /** * Statistics task instance group by given project codes list by submit time *

@@ -159,9 +129,6 @@ IPage queryStreamTaskInstanceListPaging(IPage page, @Param("startTime") Date startTime, @Param("endTime") Date endTime); - List loadAllInfosNoRelease(@Param("processInstanceId") int processInstanceId, - @Param("status") int status); - void deleteByWorkflowInstanceId(@Param("workflowInstanceId") int workflowInstanceId); List findByWorkflowInstanceId(@Param("workflowInstanceId") Integer workflowInstanceId); diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/repository/TaskInstanceDao.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/repository/TaskInstanceDao.java index 0156416fd33b..27a0dbb0f653 100644 --- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/repository/TaskInstanceDao.java +++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/repository/TaskInstanceDao.java @@ -100,9 +100,10 @@ List queryLastTaskInstanceListIntervalInProcessInstance(Integer pr /** * find last task instance corresponding to taskCode in the date interval + * * @param processInstanceId Task's parent process instance id - * @param depTaskCode taskCode - * @param testFlag test flag + * @param depTaskCode taskCode + * @param testFlag test flag * @return task instance */ TaskInstance queryLastTaskInstanceIntervalInProcessInstance(Integer processInstanceId, 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 1544d0ed8fb6..548baae56600 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 @@ -30,24 +30,6 @@ ${alias}.flag, ${alias}.is_cache, ${alias}.cache_key, ${alias}.retry_interval, ${alias}.max_retry_times, ${alias}.task_instance_priority, ${alias}.worker_group,${alias}.environment_code , ${alias}.executor_id, ${alias}.first_submit_time, ${alias}.delay_time, ${alias}.task_params, ${alias}.var_pool, ${alias}.dry_run, ${alias}.test_flag, ${alias}.task_group_id, ${alias}.task_execute_type - - update t_ds_task_instance - set state = #{destStatus} - where host = #{host} - - and state in - - #{i} - - - - - - + - + - + -