From 5f39792c668efc9f4403c0fca274e325b9cf9069 Mon Sep 17 00:00:00 2001 From: chengshiwen Date: Thu, 7 Jan 2021 14:53:34 +0800 Subject: [PATCH] remove the operation resume_from_forced_success --- .../api/enums/ExecuteType.java | 3 +- .../dolphinscheduler/api/enums/Status.java | 5 +- .../api/service/ExecutorService.java | 32 ------- .../api/service/ExecutorService2Test.java | 33 ------- .../common/enums/CommandType.java | 4 +- .../utils/placeholder/BusinessTimeUtils.java | 11 ++- .../dao/mapper/TaskInstanceMapper.java | 8 -- .../dao/mapper/TaskInstanceMapper.xml | 23 ----- .../dao/mapper/TaskInstanceMapperTest.java | 51 ----------- .../master/runner/MasterExecThread.java | 2 +- .../server/utils/AlertManager.java | 2 - .../service/process/ProcessService.java | 86 +------------------ .../js/conf/home/pages/dag/_source/config.js | 4 - .../instance/pages/list/_source/list.vue | 37 +------- .../src/js/module/i18n/locale/en_US.js | 2 - .../src/js/module/i18n/locale/zh_CN.js | 2 - 16 files changed, 12 insertions(+), 293 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/ExecuteType.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/ExecuteType.java index 3076f9fcd0..f4dac5aecd 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/ExecuteType.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/ExecuteType.java @@ -29,9 +29,8 @@ public enum ExecuteType { * 3 resume failure * 4 stop * 5 pause - * 6 resume from forced success */ - NONE, REPEAT_RUNNING, RECOVER_SUSPENDED_PROCESS, START_FAILURE_TASK_PROCESS, STOP, PAUSE, RESUME_FROM_FORCED_SUCCESS; + NONE, REPEAT_RUNNING, RECOVER_SUSPENDED_PROCESS, START_FAILURE_TASK_PROCESS, STOP, PAUSE; public static ExecuteType getEnum(int value){ diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java index 72d9f2a118..324141f57e 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java @@ -195,10 +195,10 @@ public enum Status { QUERY_WORKFLOW_LINEAGE_ERROR(10161, "query workflow lineage error", "查询血缘失败"), QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_ERROR(10162, "query authorized and user created project error error", "查询授权的和用户创建的项目错误"), DELETE_PROCESS_DEFINITION_BY_ID_FAIL(10163,"delete process definition by id fail, for there are {0} process instances in executing using it", "删除工作流定义失败,有[{0}]个运行中的工作流实例正在使用"), - CHECK_TENANT_CODE_ERROR(10164, "Please enter the English tenant code", "请输入英文租户编码"), + CHECK_OS_TENANT_CODE_ERROR(10164, "Please enter the English tenant code", "请输入英文租户编码"), FORCE_TASK_SUCCESS_ERROR(10165, "force task success error", "强制成功任务实例错误"), TASK_INSTANCE_STATE_OPERATION_ERROR(10166, "the status of task instance {0} is {1},Cannot perform force success operation", "任务实例[{0}]的状态是[{1}],无法执行强制成功操作"), - + UDF_FUNCTION_NOT_EXIST(20001, "UDF function not found", "UDF函数不存在"), UDF_FUNCTION_EXISTS(20002, "UDF function already exists", "UDF函数已存在"), @@ -252,7 +252,6 @@ public enum Status { EXPORT_PROCESS_DEFINE_BY_ID_ERROR(50028, "export process definition by id error", "导出工作流定义错误"), BATCH_EXPORT_PROCESS_DEFINE_BY_IDS_ERROR(50028,"batch export process definition by ids error", "批量导出工作流定义错误"), IMPORT_PROCESS_DEFINE_ERROR(50029, "import process definition error", "导入工作流定义错误"), - NO_VALID_FORCED_SUCCESS_TASK(50030, "there is no valid forced success node in process instance {0}", "工作流实例[{0}]中不包含有效的强制成功的任务实例"), HDFS_NOT_STARTUP(60001, "hdfs not startup", "hdfs未启用"), diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java index 1f67eedbd9..0618808555 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ExecutorService.java @@ -33,7 +33,6 @@ import org.apache.dolphinscheduler.common.enums.Priority; import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.enums.RunMode; import org.apache.dolphinscheduler.common.enums.TaskDependType; -import org.apache.dolphinscheduler.common.enums.TaskType; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.model.Server; import org.apache.dolphinscheduler.common.utils.CollectionUtils; @@ -284,13 +283,6 @@ public class ExecutorService extends BaseService { result = updateProcessInstancePrepare(processInstance, CommandType.PAUSE, ExecutionStatus.READY_PAUSE); } break; - case RESUME_FROM_FORCED_SUCCESS: - if (!this.checkValidForcedSuccessTask(processInstanceId)) { - putMsg(result, Status.NO_VALID_FORCED_SUCCESS_TASK, processInstance.getName()); - } else { - result = insertCommand(loginUser, processInstanceId, processDefinition.getId(), CommandType.RESUME_FROM_FORCED_SUCCESS); - } - break; default: logger.error("unknown execute type : {}", executeType); putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "unknown execute type"); @@ -338,7 +330,6 @@ public class ExecutorService extends BaseService { } break; case START_FAILURE_TASK_PROCESS: - case RESUME_FROM_FORCED_SUCCESS: if (executionStatus.typeIsFailure()) { checkResult = true; } @@ -618,27 +609,4 @@ public class ExecutorService extends BaseService { } return null; } - - /** - * check if the process instance contains valid forced success task - * - * @param processInstanceId - * @return - */ - private boolean checkValidForcedSuccessTask(int processInstanceId) { - List forcedSuccessList = processService.findTaskIdByInstanceState(processInstanceId, ExecutionStatus.FORCED_SUCCESS); - if (forcedSuccessList != null && !forcedSuccessList.isEmpty()) { - return true; - } - - List failedSubList = processService.findTaskIdByInstanceStatusAndType(processInstanceId, - new ExecutionStatus[]{ExecutionStatus.FAILURE, ExecutionStatus.KILL, ExecutionStatus.NEED_FAULT_TOLERANCE}, - TaskType.SUB_PROCESS); - for (int i = 0; i < failedSubList.size(); i++) { - if (processService.haveForcedSuccessInSubProcess(failedSubList.get(i))) { - return true; - } - } - return false; - } } diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ExecutorService2Test.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ExecutorService2Test.java index 532fcea581..d53b7a803b 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ExecutorService2Test.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ExecutorService2Test.java @@ -275,39 +275,6 @@ public class ExecutorService2Test { } - @Test - public void testExecute() { - List mockRes = new ArrayList<>(); - mockRes.add(1); - mockRes.add(2); - Mockito.when(processService.verifyIsNeedCreateCommand(any(Command.class))) - .thenReturn(true); - - // check execute type error - processInstance.setState(ExecutionStatus.SUCCESS); - Map checkExeTypeRes = executorService.execute(loginUser, projectName, processInstanceId, ExecuteType.RESUME_FROM_FORCED_SUCCESS); - Assert.assertEquals(Status.PROCESS_INSTANCE_STATE_OPERATION_ERROR, checkExeTypeRes.get(Constants.STATUS)); - - // no valid forced success task - processInstance.setState(ExecutionStatus.FAILURE); - Map noValidTaskRes = executorService.execute(loginUser, projectName, processInstanceId, ExecuteType.RESUME_FROM_FORCED_SUCCESS); - Assert.assertEquals(Status.NO_VALID_FORCED_SUCCESS_TASK, noValidTaskRes.get(Constants.STATUS)); - - // have forced success in sub-process - Mockito.when(processService.findTaskIdByInstanceStatusAndType(anyInt(), any(ExecutionStatus[].class), any(TaskType.class))) - .thenReturn(mockRes); - Mockito.when(processService.haveForcedSuccessInSubProcess(anyInt())) - .thenReturn(true); - Map successRes1 = executorService.execute(loginUser, projectName, processInstanceId, ExecuteType.RESUME_FROM_FORCED_SUCCESS); - Assert.assertEquals(Status.SUCCESS, successRes1.get(Constants.STATUS)); - - // test success - Mockito.when(processService.findTaskIdByInstanceState(processInstanceId, ExecutionStatus.FORCED_SUCCESS)).thenReturn(mockRes); - Map successRes = executorService.execute(loginUser, projectName, processInstanceId, ExecuteType.RESUME_FROM_FORCED_SUCCESS); - Assert.assertEquals(Status.SUCCESS, successRes.get(Constants.STATUS)); - verify(processService, times(2)).createCommand(any(Command.class)); - } - private List getMasterServersList() { List masterServerList = new ArrayList<>(); Server masterServer1 = new Server(); diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CommandType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CommandType.java index 3b663bc74d..9682016d6f 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CommandType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CommandType.java @@ -39,7 +39,6 @@ public enum CommandType { * 8 pause a process * 9 stop a process * 10 recover waiting thread - * 11 resume process from forced-success task nodes */ START_PROCESS(0, "start a new process"), START_CURRENT_TASK_PROCESS(1, "start a new process from current nodes"), @@ -51,8 +50,7 @@ public enum CommandType { REPEAT_RUNNING(7, "repeat running a process"), PAUSE(8, "pause a process"), STOP(9, "stop a process"), - RECOVER_WAITTING_THREAD(10, "recover waiting thread"), - RESUME_FROM_FORCED_SUCCESS(11, "resume process from forced-success task nodes"); + RECOVER_WAITTING_THREAD(10, "recover waiting thread"); CommandType(int code, String descp){ this.code = code; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/placeholder/BusinessTimeUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/placeholder/BusinessTimeUtils.java index 4d1a32c0b7..d5b4ab305d 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/placeholder/BusinessTimeUtils.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/placeholder/BusinessTimeUtils.java @@ -14,7 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.dolphinscheduler.common.utils.placeholder; import org.apache.dolphinscheduler.common.Constants; @@ -29,15 +28,14 @@ import static org.apache.dolphinscheduler.common.Constants.PARAMETER_FORMAT_TIME import static org.apache.dolphinscheduler.common.utils.DateUtils.format; import static org.apache.commons.lang.time.DateUtils.addDays; + /** * business time utils */ public class BusinessTimeUtils { - private BusinessTimeUtils() { throw new IllegalStateException("BusinessTimeUtils class"); } - /** * get business time in parameters by different command types * @@ -56,12 +54,13 @@ public class BusinessTimeUtils { case RECOVER_SUSPENDED_PROCESS: case START_FAILURE_TASK_PROCESS: case REPEAT_RUNNING: - case RESUME_FROM_FORCED_SUCCESS: case SCHEDULER: default: businessDate = addDays(new Date(), -1); - if (runTime != null) { - // If there is a scheduled time, take the scheduling time. Recovery from failed nodes, suspension of recovery, re-run for scheduling + if (runTime != null){ + /** + * If there is a scheduled time, take the scheduling time. Recovery from failed nodes, suspension of recovery, re-run for scheduling + */ businessDate = addDays(runTime, -1); } break; 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 0ecb654606..b0e9ca7338 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 @@ -72,12 +72,4 @@ public interface TaskInstanceMapper extends BaseMapper { @Param("startTime") Date startTime, @Param("endTime") Date endTime ); - - List queryTaskByProcessIdAndStateAndType(@Param("processInstanceId") Integer processInstanceId, - @Param("states") int[] stateArray, - @Param("taskType") String taskType); - - List queryTaskBySubProcessTaskIdAndStateAndType(@Param("subProcessTaskId") Integer subProcessTaskId, - @Param("states") int[] stateArray, - @Param("taskType") String taskType); } 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 12819fa8f9..71bd251a4a 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 @@ -152,27 +152,4 @@ order by instance.start_time desc - - diff --git a/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java b/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java index c811038735..4bef7f1b68 100644 --- a/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java +++ b/dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java @@ -26,10 +26,8 @@ import org.apache.dolphinscheduler.common.enums.TaskType; import org.apache.dolphinscheduler.dao.entity.ExecuteStatusCount; import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; import org.apache.dolphinscheduler.dao.entity.ProcessInstance; -import org.apache.dolphinscheduler.dao.entity.ProcessInstanceMap; import org.apache.dolphinscheduler.dao.entity.TaskInstance; -import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -319,53 +317,4 @@ public class TaskInstanceMapperTest { Assert.assertNotEquals(taskInstanceIPage.getTotal(), 0); } - - @Test - public void testQueryTaskByProcessIdAndStateAndType() { - // insert three task instances with the same process instance id - List taskList = new ArrayList<>(); - for (int i = 0; i < 3; i++) { - String name = "ut task" + String.valueOf(i); - taskList.add(insertOne(name, 66, ExecutionStatus.FAILURE, TaskType.SUB_PROCESS.toString())); - } - - // test query result - List resultArray = taskInstanceMapper.queryTaskByProcessIdAndStateAndType(66, - new int[] {ExecutionStatus.FAILURE.ordinal(), ExecutionStatus.KILL.ordinal(), ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal()}, - TaskType.SUB_PROCESS.toString()); - Assert.assertEquals(3, resultArray.size()); - - // delete - for (int i = 0; i < 3; i++) { - taskInstanceMapper.deleteById(taskList.get(i)); - } - } - - @Test - public void testQueryTaskBySubProcessTaskIdAndStateAndType() { - TaskInstance parentTask = insertOne("parent-task", 66, ExecutionStatus.FAILURE, TaskType.SUB_PROCESS.toString()); - - ProcessInstanceMap processInstanceMap = new ProcessInstanceMap(); - processInstanceMap.setParentProcessInstanceId(66); - processInstanceMap.setParentTaskInstanceId(parentTask.getId()); - processInstanceMap.setProcessInstanceId(67); - processInstanceMapMapper.insert(processInstanceMap); - - TaskInstance subTask1 = insertOne("sub1", 67, ExecutionStatus.SUCCESS, TaskType.SHELL.toString()); - TaskInstance subTask2 = insertOne("sub2", 67, ExecutionStatus.FORCED_SUCCESS, TaskType.SHELL.toString()); - - // test query result - List resultList = taskInstanceMapper.queryTaskBySubProcessTaskIdAndStateAndType(parentTask.getId(), - new int[] {ExecutionStatus.FORCED_SUCCESS.ordinal()}, - null); - - Assert.assertEquals(1, resultList.size()); - Assert.assertEquals(subTask2.getId(), resultList.get(0).intValue()); - - // delete - taskInstanceMapper.deleteById(parentTask.getId()); - processInstanceMapMapper.deleteById(processInstanceMap.getId()); - taskInstanceMapper.deleteById(subTask1.getId()); - taskInstanceMapper.deleteById(subTask2.getId()); - } } diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java index 820cfe584d..f5946d5614 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java @@ -414,7 +414,7 @@ public class MasterExecThread implements Runnable { if (task.isConditionsTask() || DagHelper.haveConditionsAfterNode(task.getName(), dag)) { continue; } - if (task.getState().typeIsFailure() && !task.taskCanRetry() && !task.isConditionsTask()) { + if (task.getState().typeIsFailure() && !task.taskCanRetry()) { errorTaskList.put(task.getName(), task); } } diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/AlertManager.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/AlertManager.java index 17dc049103..6b8d926c0f 100644 --- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/AlertManager.java +++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/AlertManager.java @@ -81,8 +81,6 @@ public class AlertManager { return "pause"; case STOP: return "stop"; - case RESUME_FROM_FORCED_SUCCESS: - return "resume from forced success"; default: return "unknown type"; } diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java index ad1728ba57..529f90caee 100644 --- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java +++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java @@ -37,7 +37,6 @@ import org.apache.dolphinscheduler.common.enums.FailureStrategy; import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.ResourceType; import org.apache.dolphinscheduler.common.enums.TaskDependType; -import org.apache.dolphinscheduler.common.enums.TaskType; import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.model.DateInterval; import org.apache.dolphinscheduler.common.model.TaskNode; @@ -263,7 +262,6 @@ public class ProcessService { cmdTypeMap.put(CommandType.REPEAT_RUNNING, 1); cmdTypeMap.put(CommandType.RECOVER_SUSPENDED_PROCESS, 1); cmdTypeMap.put(CommandType.START_FAILURE_TASK_PROCESS, 1); - cmdTypeMap.put(CommandType.RESUME_FROM_FORCED_SUCCESS, 1); CommandType commandType = command.getCommandType(); if (cmdTypeMap.containsKey(commandType)) { @@ -710,6 +708,7 @@ public class ProcessService { List failedList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.FAILURE); List toleranceList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.NEED_FAULT_TOLERANCE); List killedList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.KILL); + // List forcedList = this.findTaskIdByInstanceState(processInstance.getId(), ExecutionStatus.FORCED_SUCCESS); cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); failedList.addAll(killedList); @@ -774,31 +773,6 @@ public class ProcessService { break; case SCHEDULER: break; - case RESUME_FROM_FORCED_SUCCESS: - List failedSubList = this.findTaskIdByInstanceStatusAndType(processInstance.getId(), - new ExecutionStatus[]{ExecutionStatus.FAILURE, ExecutionStatus.KILL, ExecutionStatus.NEED_FAULT_TOLERANCE}, - TaskType.SUB_PROCESS); - - for (int i = 0; i < failedSubList.size(); i++) { - // if there exists forced success in the sub_process - if (haveForcedSuccessInSubProcess(failedSubList.get(i))) { - // change sub_process task's state into submitted_success - TaskInstance taskInstance = this.findTaskInstanceById(failedSubList.get(i)); - taskInstance.setState(ExecutionStatus.SUBMITTED_SUCCESS); - updateTaskInstance(taskInstance); - } - } - /** - * set resume node list to null - * 1. we can have a complete dag in the ExecThread so that it can restore the previous context - * 2. each time the operation is done the state of process will be reasonable as usual - */ - cmdParam.remove(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING); - cmdParam.put(Constants.CMD_PARAM_RECOVERY_START_NODE_STRING, - String.join(Constants.COMMA, convertIntListToString(null))); - processInstance.setCommandParam(JSONUtils.toJsonString(cmdParam)); - processInstance.setRunTimes(runTime + 1); - break; default: break; } @@ -806,30 +780,6 @@ public class ProcessService { return processInstance; } - /** - * recursively check if a sub process node contains forced success node - * @param taskInstanceId task instance id - * @return true or false - */ - public boolean haveForcedSuccessInSubProcess(int taskInstanceId) { - List forcedSuccessList = this.findTaskIdInSubProcessByStatusAndType(taskInstanceId, - new ExecutionStatus[]{ExecutionStatus.FORCED_SUCCESS}, - null); - if (forcedSuccessList != null && !forcedSuccessList.isEmpty()) { - return true; - } - - List childSubList = this.findTaskIdInSubProcessByStatusAndType(taskInstanceId, - new ExecutionStatus[]{ExecutionStatus.FAILURE, ExecutionStatus.KILL, ExecutionStatus.NEED_FAULT_TOLERANCE}, - TaskType.SUB_PROCESS); - for (Integer child : childSubList) { - if (haveForcedSuccessInSubProcess(child)) { - return true; - } - } - return false; - } - /** * return complement data if the process start with complement data * @@ -1413,40 +1363,6 @@ public class ProcessService { return taskInstanceMapper.queryTaskByProcessIdAndState(instanceId, state.ordinal()); } - /** - * get id list by task state and type - * @param processInstanceId process instance id - * @param states task instance state array - * @param taskType task type - * @return task instance id list - */ - public List findTaskIdByInstanceStatusAndType(int processInstanceId, ExecutionStatus[] states, TaskType taskType) { - int[] statesArray = new int[states.length]; - for (int i = 0; i < states.length; i++) { - statesArray[i] = states[i].ordinal(); - } - return taskInstanceMapper.queryTaskByProcessIdAndStateAndType(processInstanceId, statesArray, taskType.toString()); - } - - /** - * get tasks in sub_process by sub_process task id and state and type - * if param type is null, it queries all types - * @param taskId task instance id - * @param states task instance state array - * @param taskType task type - * @return task instance id list - */ - public List findTaskIdInSubProcessByStatusAndType(int taskId, ExecutionStatus[] states, TaskType taskType) { - int[] statesArray = new int[states.length]; - for (int i = 0; i < states.length; i++) { - statesArray[i] = states[i].ordinal(); - } - if (taskType == null) { - return taskInstanceMapper.queryTaskBySubProcessTaskIdAndStateAndType(taskId, statesArray, null); - } - return taskInstanceMapper.queryTaskBySubProcessTaskIdAndStateAndType(taskId, statesArray, taskType.toString()); - } - /** * find valid task list by process definition id * diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js index 673ff9f6ff..0fc7e8ecd9 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js @@ -133,10 +133,6 @@ const runningType = [ { desc: `${i18n.$t('Recovery waiting thread')}`, code: 'RECOVER_WAITTING_THREAD' - }, - { - desc: `${i18n.$t('Resume from forced success')}`, - code: 'RESUME_FROM_FORCED_SUCCESS' } ] diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue index 6044c17f87..980a755120 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue @@ -61,7 +61,7 @@ - +