|
|
@ -23,9 +23,11 @@ import org.apache.dolphinscheduler.common.enums.TaskType; |
|
|
|
import org.apache.dolphinscheduler.common.task.TaskTimeoutParameter; |
|
|
|
import org.apache.dolphinscheduler.common.task.TaskTimeoutParameter; |
|
|
|
import org.apache.dolphinscheduler.common.utils.CollectionUtils; |
|
|
|
import org.apache.dolphinscheduler.common.utils.CollectionUtils; |
|
|
|
import org.apache.dolphinscheduler.common.utils.*; |
|
|
|
import org.apache.dolphinscheduler.common.utils.*; |
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
|
|
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
|
|
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|
|
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.utils.StringUtils; |
|
|
|
import org.apache.dolphinscheduler.common.utils.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
@ -35,330 +37,299 @@ import java.util.Objects; |
|
|
|
|
|
|
|
|
|
|
|
public class TaskNode { |
|
|
|
public class TaskNode { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* task node id |
|
|
|
* task node id |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String id; |
|
|
|
private String id; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* task node name |
|
|
|
* task node code |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String name; |
|
|
|
private Long code; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* task node description |
|
|
|
* task node version |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String desc; |
|
|
|
private int version; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* task node type |
|
|
|
* task node name |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String type; |
|
|
|
private String name; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* the run flag has two states, NORMAL or FORBIDDEN |
|
|
|
* task node description |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String runFlag; |
|
|
|
private String desc; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* the front field |
|
|
|
* task node type |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String loc; |
|
|
|
private String type; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* maximum number of retries |
|
|
|
* the run flag has two states, NORMAL or FORBIDDEN |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private int maxRetryTimes; |
|
|
|
private String runFlag; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Unit of retry interval: points |
|
|
|
* the front field |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private int retryInterval; |
|
|
|
private String loc; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* params information |
|
|
|
* maximum number of retries |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
private int maxRetryTimes; |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
|
|
|
|
private String params; |
|
|
|
/** |
|
|
|
|
|
|
|
* Unit of retry interval: points |
|
|
|
/** |
|
|
|
*/ |
|
|
|
* inner dependency information |
|
|
|
private int retryInterval; |
|
|
|
*/ |
|
|
|
|
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
/** |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
* params information |
|
|
|
private String preTasks; |
|
|
|
*/ |
|
|
|
|
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
/** |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
* users store additional information |
|
|
|
private String params; |
|
|
|
*/ |
|
|
|
|
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
/** |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
* inner dependency information |
|
|
|
private String extras; |
|
|
|
*/ |
|
|
|
|
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
/** |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
* node dependency list |
|
|
|
private String preTasks; |
|
|
|
*/ |
|
|
|
|
|
|
|
private List<String> depList; |
|
|
|
/** |
|
|
|
|
|
|
|
* users store additional information |
|
|
|
/** |
|
|
|
*/ |
|
|
|
* outer dependency information |
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
*/ |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
private String extras; |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
|
|
|
|
private String dependence; |
|
|
|
/** |
|
|
|
|
|
|
|
* node dependency list |
|
|
|
|
|
|
|
*/ |
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
private List<String> depList; |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
|
|
|
|
private String conditionResult; |
|
|
|
/** |
|
|
|
|
|
|
|
* outer dependency information |
|
|
|
/** |
|
|
|
*/ |
|
|
|
* task instance priority |
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
*/ |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
private Priority taskInstancePriority; |
|
|
|
private String dependence; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* worker group |
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
*/ |
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
private String workerGroup; |
|
|
|
private String conditionResult; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* worker group id |
|
|
|
* task instance priority |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private Integer workerGroupId; |
|
|
|
private Priority taskInstancePriority; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* worker group |
|
|
|
* task time out |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private String workerGroup; |
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
|
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
/** |
|
|
|
private String timeout; |
|
|
|
* worker group id |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private Integer workerGroupId; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* task time out |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@JsonDeserialize(using = JSONUtils.JsonDataDeserializer.class) |
|
|
|
|
|
|
|
@JsonSerialize(using = JSONUtils.JsonDataSerializer.class) |
|
|
|
|
|
|
|
private String timeout; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* delay execution time. |
|
|
|
* delay execution time. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private int delayTime; |
|
|
|
private int delayTime; |
|
|
|
|
|
|
|
|
|
|
|
public String getId() { |
|
|
|
public String getId() { |
|
|
|
return id; |
|
|
|
return id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setId(String id) { |
|
|
|
public void setId(String id) { |
|
|
|
this.id = id; |
|
|
|
this.id = id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getName() { |
|
|
|
public String getName() { |
|
|
|
return name; |
|
|
|
return name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setName(String name) { |
|
|
|
public void setName(String name) { |
|
|
|
this.name = name; |
|
|
|
this.name = name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getDesc() { |
|
|
|
public String getDesc() { |
|
|
|
return desc; |
|
|
|
return desc; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setDesc(String desc) { |
|
|
|
public void setDesc(String desc) { |
|
|
|
this.desc = desc; |
|
|
|
this.desc = desc; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getType() { |
|
|
|
public String getType() { |
|
|
|
return type; |
|
|
|
return type; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setType(String type) { |
|
|
|
public void setType(String type) { |
|
|
|
this.type = type; |
|
|
|
this.type = type; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getParams() { |
|
|
|
public String getParams() { |
|
|
|
return params; |
|
|
|
return params; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setParams(String params) { |
|
|
|
public void setParams(String params) { |
|
|
|
this.params = params; |
|
|
|
this.params = params; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getPreTasks() { |
|
|
|
public String getPreTasks() { |
|
|
|
return preTasks; |
|
|
|
return preTasks; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setPreTasks(String preTasks) throws IOException { |
|
|
|
public void setPreTasks(String preTasks) throws IOException { |
|
|
|
this.preTasks = preTasks; |
|
|
|
this.preTasks = preTasks; |
|
|
|
this.depList = JSONUtils.toList(preTasks, String.class); |
|
|
|
this.depList = JSONUtils.toList(preTasks, String.class); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getExtras() { |
|
|
|
public String getExtras() { |
|
|
|
return extras; |
|
|
|
return extras; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setExtras(String extras) { |
|
|
|
public void setExtras(String extras) { |
|
|
|
this.extras = extras; |
|
|
|
this.extras = extras; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<String> getDepList() { |
|
|
|
public List<String> getDepList() { |
|
|
|
return depList; |
|
|
|
return depList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setDepList(List<String> depList) throws JsonProcessingException { |
|
|
|
public void setDepList(List<String> depList) throws JsonProcessingException { |
|
|
|
this.depList = depList; |
|
|
|
this.depList = depList; |
|
|
|
this.preTasks = JSONUtils.toJsonString(depList); |
|
|
|
this.preTasks = JSONUtils.toJsonString(depList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getLoc() { |
|
|
|
public String getLoc() { |
|
|
|
return loc; |
|
|
|
return loc; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setLoc(String loc) { |
|
|
|
public void setLoc(String loc) { |
|
|
|
this.loc = loc; |
|
|
|
this.loc = loc; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getRunFlag(){ |
|
|
|
public String getRunFlag() { |
|
|
|
return runFlag; |
|
|
|
return runFlag; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setRunFlag(String runFlag) { |
|
|
|
public void setRunFlag(String runFlag) { |
|
|
|
this.runFlag = runFlag; |
|
|
|
this.runFlag = runFlag; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Boolean isForbidden(){ |
|
|
|
public Boolean isForbidden() { |
|
|
|
return (StringUtils.isNotEmpty(this.runFlag) && |
|
|
|
return (StringUtils.isNotEmpty(this.runFlag) |
|
|
|
this.runFlag.equals(Constants.FLOWNODE_RUN_FLAG_FORBIDDEN)); |
|
|
|
&& this.runFlag.equals(Constants.FLOWNODE_RUN_FLAG_FORBIDDEN)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean equals(Object o) { |
|
|
|
public boolean equals(Object o) { |
|
|
|
if (this == o) { |
|
|
|
if (this == o) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (o == null || getClass() != o.getClass()) { |
|
|
|
if (o == null || getClass() != o.getClass()) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
TaskNode taskNode = (TaskNode) o; |
|
|
|
TaskNode taskNode = (TaskNode) o; |
|
|
|
return Objects.equals(name, taskNode.name) && |
|
|
|
return Objects.equals(name, taskNode.name) |
|
|
|
Objects.equals(desc, taskNode.desc) && |
|
|
|
&& Objects.equals(desc, taskNode.desc) |
|
|
|
Objects.equals(type, taskNode.type) && |
|
|
|
&& Objects.equals(type, taskNode.type) |
|
|
|
Objects.equals(params, taskNode.params) && |
|
|
|
&& Objects.equals(params, taskNode.params) |
|
|
|
Objects.equals(preTasks, taskNode.preTasks) && |
|
|
|
&& Objects.equals(preTasks, taskNode.preTasks) |
|
|
|
Objects.equals(extras, taskNode.extras) && |
|
|
|
&& Objects.equals(extras, taskNode.extras) |
|
|
|
Objects.equals(runFlag, taskNode.runFlag) && |
|
|
|
&& Objects.equals(runFlag, taskNode.runFlag) |
|
|
|
Objects.equals(dependence, taskNode.dependence) && |
|
|
|
&& Objects.equals(dependence, taskNode.dependence) |
|
|
|
Objects.equals(workerGroup, taskNode.workerGroup) && |
|
|
|
&& Objects.equals(workerGroup, taskNode.workerGroup) |
|
|
|
Objects.equals(conditionResult, taskNode.conditionResult) && |
|
|
|
&& Objects.equals(conditionResult, taskNode.conditionResult) |
|
|
|
|
|
|
|
&& CollectionUtils.equalLists(depList, taskNode.depList); |
|
|
|
CollectionUtils.equalLists(depList, taskNode.depList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public int hashCode() { |
|
|
|
public int hashCode() { |
|
|
|
return Objects.hash(name, desc, type, params, preTasks, extras, depList, runFlag); |
|
|
|
return Objects.hash(name, desc, type, params, preTasks, extras, depList, runFlag); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getDependence() { |
|
|
|
public String getDependence() { |
|
|
|
return dependence; |
|
|
|
return dependence; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setDependence(String dependence) { |
|
|
|
public void setDependence(String dependence) { |
|
|
|
this.dependence = dependence; |
|
|
|
this.dependence = dependence; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getMaxRetryTimes() { |
|
|
|
public int getMaxRetryTimes() { |
|
|
|
return maxRetryTimes; |
|
|
|
return maxRetryTimes; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setMaxRetryTimes(int maxRetryTimes) { |
|
|
|
public void setMaxRetryTimes(int maxRetryTimes) { |
|
|
|
this.maxRetryTimes = maxRetryTimes; |
|
|
|
this.maxRetryTimes = maxRetryTimes; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public int getRetryInterval() { |
|
|
|
public int getRetryInterval() { |
|
|
|
return retryInterval; |
|
|
|
return retryInterval; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setRetryInterval(int retryInterval) { |
|
|
|
public void setRetryInterval(int retryInterval) { |
|
|
|
this.retryInterval = retryInterval; |
|
|
|
this.retryInterval = retryInterval; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Priority getTaskInstancePriority() { |
|
|
|
public Priority getTaskInstancePriority() { |
|
|
|
return taskInstancePriority; |
|
|
|
return taskInstancePriority; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setTaskInstancePriority(Priority taskInstancePriority) { |
|
|
|
public void setTaskInstancePriority(Priority taskInstancePriority) { |
|
|
|
this.taskInstancePriority = taskInstancePriority; |
|
|
|
this.taskInstancePriority = taskInstancePriority; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getTimeout() { |
|
|
|
public String getTimeout() { |
|
|
|
return timeout; |
|
|
|
return timeout; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setTimeout(String timeout) { |
|
|
|
public void setTimeout(String timeout) { |
|
|
|
this.timeout = timeout; |
|
|
|
this.timeout = timeout; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getWorkerGroup() { |
|
|
|
/** |
|
|
|
return workerGroup; |
|
|
|
* get task time out parameter |
|
|
|
} |
|
|
|
* @return task time out parameter |
|
|
|
|
|
|
|
*/ |
|
|
|
public void setWorkerGroup(String workerGroup) { |
|
|
|
public TaskTimeoutParameter getTaskTimeoutParameter() { |
|
|
|
this.workerGroup = workerGroup; |
|
|
|
if(StringUtils.isNotEmpty(this.getTimeout())){ |
|
|
|
} |
|
|
|
String formatStr = String.format("%s,%s", TaskTimeoutStrategy.WARN.name(), TaskTimeoutStrategy.FAILED.name()); |
|
|
|
|
|
|
|
String taskTimeout = this.getTimeout().replace(formatStr,TaskTimeoutStrategy.WARNFAILED.name()); |
|
|
|
public String getConditionResult() { |
|
|
|
return JSONUtils.parseObject(taskTimeout,TaskTimeoutParameter.class); |
|
|
|
return conditionResult; |
|
|
|
} |
|
|
|
} |
|
|
|
return new TaskTimeoutParameter(false); |
|
|
|
|
|
|
|
} |
|
|
|
public void setConditionResult(String conditionResult) { |
|
|
|
|
|
|
|
this.conditionResult = conditionResult; |
|
|
|
public boolean isConditionsTask(){ |
|
|
|
} |
|
|
|
return TaskType.CONDITIONS.toString().equalsIgnoreCase(this.getType()); |
|
|
|
|
|
|
|
} |
|
|
|
public Integer getWorkerGroupId() { |
|
|
|
|
|
|
|
return workerGroupId; |
|
|
|
@Override |
|
|
|
} |
|
|
|
public String toString() { |
|
|
|
|
|
|
|
return "TaskNode{" |
|
|
|
public void setWorkerGroupId(Integer workerGroupId) { |
|
|
|
+ "id='" + id + '\'' |
|
|
|
this.workerGroupId = workerGroupId; |
|
|
|
+ ", name='" + name + '\'' |
|
|
|
} |
|
|
|
+ ", desc='" + desc + '\'' |
|
|
|
|
|
|
|
+ ", type='" + type + '\'' |
|
|
|
|
|
|
|
+ ", runFlag='" + runFlag + '\'' |
|
|
|
|
|
|
|
+ ", loc='" + loc + '\'' |
|
|
|
|
|
|
|
+ ", maxRetryTimes=" + maxRetryTimes |
|
|
|
|
|
|
|
+ ", retryInterval=" + retryInterval |
|
|
|
|
|
|
|
+ ", params='" + params + '\'' |
|
|
|
|
|
|
|
+ ", preTasks='" + preTasks + '\'' |
|
|
|
|
|
|
|
+ ", extras='" + extras + '\'' |
|
|
|
|
|
|
|
+ ", depList=" + depList |
|
|
|
|
|
|
|
+ ", dependence='" + dependence + '\'' |
|
|
|
|
|
|
|
+ ", taskInstancePriority=" + taskInstancePriority |
|
|
|
|
|
|
|
+ ", timeout='" + timeout + '\'' |
|
|
|
|
|
|
|
+ ", workerGroup='" + workerGroup + '\'' |
|
|
|
|
|
|
|
+ ", delayTime=" + delayTime |
|
|
|
|
|
|
|
+ '}'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getWorkerGroup() { |
|
|
|
|
|
|
|
return workerGroup; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setWorkerGroup(String workerGroup) { |
|
|
|
|
|
|
|
this.workerGroup = workerGroup; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getConditionResult() { |
|
|
|
|
|
|
|
return conditionResult; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setConditionResult(String conditionResult) { |
|
|
|
|
|
|
|
this.conditionResult = conditionResult; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Integer getWorkerGroupId() { |
|
|
|
|
|
|
|
return workerGroupId; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setWorkerGroupId(Integer workerGroupId) { |
|
|
|
|
|
|
|
this.workerGroupId = workerGroupId; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getDelayTime() { |
|
|
|
public int getDelayTime() { |
|
|
|
return delayTime; |
|
|
|
return delayTime; |
|
|
@ -367,4 +338,62 @@ public class TaskNode { |
|
|
|
public void setDelayTime(int delayTime) { |
|
|
|
public void setDelayTime(int delayTime) { |
|
|
|
this.delayTime = delayTime; |
|
|
|
this.delayTime = delayTime; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Long getCode() { |
|
|
|
|
|
|
|
return code; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setCode(Long code) { |
|
|
|
|
|
|
|
this.code = code; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getVersion() { |
|
|
|
|
|
|
|
return version; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setVersion(int version) { |
|
|
|
|
|
|
|
this.version = version; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* get task time out parameter |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return task time out parameter |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public TaskTimeoutParameter getTaskTimeoutParameter() { |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(this.getTimeout())) { |
|
|
|
|
|
|
|
String formatStr = String.format("%s,%s", TaskTimeoutStrategy.WARN.name(), TaskTimeoutStrategy.FAILED.name()); |
|
|
|
|
|
|
|
String taskTimeout = this.getTimeout().replace(formatStr, TaskTimeoutStrategy.WARNFAILED.name()); |
|
|
|
|
|
|
|
return JSONUtils.parseObject(taskTimeout, TaskTimeoutParameter.class); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return new TaskTimeoutParameter(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isConditionsTask() { |
|
|
|
|
|
|
|
return TaskType.CONDITIONS.toString().equalsIgnoreCase(this.getType()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String toString() { |
|
|
|
|
|
|
|
return "TaskNode{" |
|
|
|
|
|
|
|
+ "id='" + id + '\'' |
|
|
|
|
|
|
|
+ ", name='" + name + '\'' |
|
|
|
|
|
|
|
+ ", desc='" + desc + '\'' |
|
|
|
|
|
|
|
+ ", type='" + type + '\'' |
|
|
|
|
|
|
|
+ ", runFlag='" + runFlag + '\'' |
|
|
|
|
|
|
|
+ ", loc='" + loc + '\'' |
|
|
|
|
|
|
|
+ ", maxRetryTimes=" + maxRetryTimes |
|
|
|
|
|
|
|
+ ", retryInterval=" + retryInterval |
|
|
|
|
|
|
|
+ ", params='" + params + '\'' |
|
|
|
|
|
|
|
+ ", preTasks='" + preTasks + '\'' |
|
|
|
|
|
|
|
+ ", extras='" + extras + '\'' |
|
|
|
|
|
|
|
+ ", depList=" + depList |
|
|
|
|
|
|
|
+ ", dependence='" + dependence + '\'' |
|
|
|
|
|
|
|
+ ", taskInstancePriority=" + taskInstancePriority |
|
|
|
|
|
|
|
+ ", timeout='" + timeout + '\'' |
|
|
|
|
|
|
|
+ ", workerGroup='" + workerGroup + '\'' |
|
|
|
|
|
|
|
+ ", delayTime=" + delayTime |
|
|
|
|
|
|
|
+ '}'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|