|
|
@ -17,19 +17,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.server.master.runner; |
|
|
|
package org.apache.dolphinscheduler.server.master.runner; |
|
|
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST; |
|
|
|
import lombok.NonNull; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVERY_START_NODE_STRING; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; |
|
|
|
import org.apache.commons.lang3.math.NumberUtils; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_START_NODES; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.COMMA; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.DEFAULT_WORKER_GROUP; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.YYYY_MM_DD_HH_MM_SS; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_BLOCKING; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.enums.DataType.VARCHAR; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.enums.Direct.IN; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
import org.apache.dolphinscheduler.common.enums.CommandType; |
|
|
|
import org.apache.dolphinscheduler.common.enums.CommandType; |
|
|
|
import org.apache.dolphinscheduler.common.enums.FailureStrategy; |
|
|
|
import org.apache.dolphinscheduler.common.enums.FailureStrategy; |
|
|
@ -68,7 +60,13 @@ import org.apache.dolphinscheduler.remote.command.HostUpdateCommand; |
|
|
|
import org.apache.dolphinscheduler.remote.utils.Host; |
|
|
|
import org.apache.dolphinscheduler.remote.utils.Host; |
|
|
|
import org.apache.dolphinscheduler.server.master.config.MasterConfig; |
|
|
|
import org.apache.dolphinscheduler.server.master.config.MasterConfig; |
|
|
|
import org.apache.dolphinscheduler.server.master.dispatch.executor.NettyExecutorManager; |
|
|
|
import org.apache.dolphinscheduler.server.master.dispatch.executor.NettyExecutorManager; |
|
|
|
import org.apache.dolphinscheduler.server.master.event.*; |
|
|
|
import org.apache.dolphinscheduler.server.master.event.StateEvent; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.server.master.event.StateEventHandleError; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.server.master.event.StateEventHandleException; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.server.master.event.StateEventHandler; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.server.master.event.StateEventHandlerManager; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.server.master.event.TaskStateEvent; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.server.master.event.WorkflowStateEvent; |
|
|
|
import org.apache.dolphinscheduler.server.master.metrics.TaskMetrics; |
|
|
|
import org.apache.dolphinscheduler.server.master.metrics.TaskMetrics; |
|
|
|
import org.apache.dolphinscheduler.server.master.runner.task.ITaskProcessor; |
|
|
|
import org.apache.dolphinscheduler.server.master.runner.task.ITaskProcessor; |
|
|
|
import org.apache.dolphinscheduler.server.master.runner.task.TaskAction; |
|
|
|
import org.apache.dolphinscheduler.server.master.runner.task.TaskAction; |
|
|
@ -79,10 +77,9 @@ import org.apache.dolphinscheduler.service.exceptions.CronParseException; |
|
|
|
import org.apache.dolphinscheduler.service.expand.CuringParamsService; |
|
|
|
import org.apache.dolphinscheduler.service.expand.CuringParamsService; |
|
|
|
import org.apache.dolphinscheduler.service.process.ProcessService; |
|
|
|
import org.apache.dolphinscheduler.service.process.ProcessService; |
|
|
|
import org.apache.dolphinscheduler.service.queue.PeerTaskInstancePriorityQueue; |
|
|
|
import org.apache.dolphinscheduler.service.queue.PeerTaskInstancePriorityQueue; |
|
|
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.apache.commons.lang3.math.NumberUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Arrays; |
|
|
@ -103,13 +100,18 @@ import java.util.concurrent.ConcurrentLinkedQueue; |
|
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_START_DATE; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVERY_START_NODE_STRING; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_START_NODES; |
|
|
|
import lombok.NonNull; |
|
|
|
import static org.apache.dolphinscheduler.common.Constants.COMMA; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.DEFAULT_WORKER_GROUP; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.YYYY_MM_DD_HH_MM_SS; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_BLOCKING; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.enums.DataType.VARCHAR; |
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.enums.Direct.IN; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Workflow execute task, used to execute a workflow instance. |
|
|
|
* Workflow execute task, used to execute a workflow instance. |
|
|
@ -1509,7 +1511,9 @@ public class WorkflowExecuteRunnable implements Callable<WorkflowSubmitStatue> { |
|
|
|
return WorkflowExecutionStatus.FAILURE; |
|
|
|
return WorkflowExecutionStatus.FAILURE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (processInstance.isBlocked() || !isComplementEnd() || readyToSubmitTaskQueue.size() > 0) { |
|
|
|
List<TaskInstance> pauseList = getCompleteTaskByState(TaskExecutionStatus.PAUSE); |
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(pauseList) || processInstance.isBlocked() || !isComplementEnd() |
|
|
|
|
|
|
|
|| readyToSubmitTaskQueue.size() > 0) { |
|
|
|
return WorkflowExecutionStatus.PAUSE; |
|
|
|
return WorkflowExecutionStatus.PAUSE; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return WorkflowExecutionStatus.SUCCESS; |
|
|
|
return WorkflowExecutionStatus.SUCCESS; |
|
|
@ -1534,7 +1538,7 @@ public class WorkflowExecuteRunnable implements Callable<WorkflowSubmitStatue> { |
|
|
|
} |
|
|
|
} |
|
|
|
if (readyToSubmitTaskQueue.size() > 0) { |
|
|
|
if (readyToSubmitTaskQueue.size() > 0) { |
|
|
|
for (Iterator<TaskInstance> iter = readyToSubmitTaskQueue.iterator(); iter.hasNext();) { |
|
|
|
for (Iterator<TaskInstance> iter = readyToSubmitTaskQueue.iterator(); iter.hasNext();) { |
|
|
|
iter.next().setState(TaskExecutionStatus.KILL); |
|
|
|
iter.next().setState(TaskExecutionStatus.PAUSE); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return WorkflowExecutionStatus.BLOCK; |
|
|
|
return WorkflowExecutionStatus.BLOCK; |
|
|
|