Browse Source

Serial wait for subsequent execution (#9847)

3.0.0/version-upgrade
WangJPLeo 3 years ago committed by GitHub
parent
commit
31cd1b5e61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java
  2. 2
      dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java
  3. 3
      dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/enums/CommandType.java

1
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterSchedulerService.java

@ -21,6 +21,7 @@ import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.SlotCheckState; import org.apache.dolphinscheduler.common.enums.SlotCheckState;
import org.apache.dolphinscheduler.common.thread.Stopper; import org.apache.dolphinscheduler.common.thread.Stopper;
import org.apache.dolphinscheduler.common.thread.ThreadUtils; import org.apache.dolphinscheduler.common.thread.ThreadUtils;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.common.utils.NetUtils; import org.apache.dolphinscheduler.common.utils.NetUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils; import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.dao.entity.Command; import org.apache.dolphinscheduler.dao.entity.Command;

2
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/WorkflowExecuteThread.java

@ -837,7 +837,9 @@ public class WorkflowExecuteThread {
cmdParam.put(CMD_PARAM_RECOVER_PROCESS_ID_STRING, nextInstanceId); cmdParam.put(CMD_PARAM_RECOVER_PROCESS_ID_STRING, nextInstanceId);
Command command = new Command(); Command command = new Command();
command.setCommandType(CommandType.RECOVER_SERIAL_WAIT); command.setCommandType(CommandType.RECOVER_SERIAL_WAIT);
command.setProcessInstanceId(nextProcessInstance.getId());
command.setProcessDefinitionCode(processDefinition.getCode()); command.setProcessDefinitionCode(processDefinition.getCode());
command.setProcessDefinitionVersion(processDefinition.getVersion());
command.setCommandParam(JSONUtils.toJsonString(cmdParam)); command.setCommandParam(JSONUtils.toJsonString(cmdParam));
processService.createCommand(command); processService.createCommand(command);
} }

3
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/enums/CommandType.java

@ -49,7 +49,8 @@ public enum CommandType {
REPEAT_RUNNING(7, "repeat running a process"), REPEAT_RUNNING(7, "repeat running a process"),
PAUSE(8, "pause a process"), PAUSE(8, "pause a process"),
STOP(9, "stop a process"), STOP(9, "stop a process"),
RECOVER_WAITING_THREAD(10, "recover waiting thread"); RECOVER_WAITING_THREAD(10, "recover waiting thread"),
RECOVER_SERIAL_WAIT(11, "recover serial wait");
CommandType(int code, String descp) { CommandType(int code, String descp) {
this.code = code; this.code = code;

Loading…
Cancel
Save