|
|
|
@ -17,19 +17,11 @@
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.server.master.runner; |
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST; |
|
|
|
|
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 static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; |
|
|
|
|
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 com.google.common.collect.Lists; |
|
|
|
|
import lombok.NonNull; |
|
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.apache.commons.lang3.math.NumberUtils; |
|
|
|
|
import org.apache.dolphinscheduler.common.Constants; |
|
|
|
|
import org.apache.dolphinscheduler.common.enums.CommandType; |
|
|
|
|
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.server.master.config.MasterConfig; |
|
|
|
|
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.runner.task.ITaskProcessor; |
|
|
|
|
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.process.ProcessService; |
|
|
|
|
import org.apache.dolphinscheduler.service.queue.PeerTaskInstancePriorityQueue; |
|
|
|
|
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.apache.commons.lang3.math.NumberUtils; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
@ -103,13 +100,18 @@ import java.util.concurrent.ConcurrentLinkedQueue;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
|
|
|
|
|
import com.google.common.collect.Lists; |
|
|
|
|
|
|
|
|
|
import lombok.NonNull; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_END_DATE; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMDPARAM_COMPLEMENT_DATA_SCHEDULE_DATE_LIST; |
|
|
|
|
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 static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_RECOVER_PROCESS_ID_STRING; |
|
|
|
|
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; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Workflow execute task, used to execute a workflow instance. |
|
|
|
@ -1509,7 +1511,9 @@ public class WorkflowExecuteRunnable implements Callable<WorkflowSubmitStatue> {
|
|
|
|
|
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; |
|
|
|
|
} else { |
|
|
|
|
return WorkflowExecutionStatus.SUCCESS; |
|
|
|
@ -1534,7 +1538,7 @@ public class WorkflowExecuteRunnable implements Callable<WorkflowSubmitStatue> {
|
|
|
|
|
} |
|
|
|
|
if (readyToSubmitTaskQueue.size() > 0) { |
|
|
|
|
for (Iterator<TaskInstance> iter = readyToSubmitTaskQueue.iterator(); iter.hasNext();) { |
|
|
|
|
iter.next().setState(TaskExecutionStatus.KILL); |
|
|
|
|
iter.next().setState(TaskExecutionStatus.PAUSE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return WorkflowExecutionStatus.BLOCK; |
|
|
|
|