Browse Source
* task and relation entity * task and relation entity * task and relation entity * task and relation entity * task and relation entity * add timeout flag Co-authored-by: JinyLeeChina <297062848@qq.com>pull/3/MERGE
JinyLeeChina
4 years ago
committed by
GitHub
7 changed files with 1387 additions and 12 deletions
@ -0,0 +1,51 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.common.enums; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue; |
||||
|
||||
/** |
||||
* condition type |
||||
*/ |
||||
public enum ConditionType { |
||||
/** |
||||
* 0 none |
||||
* 1 judge |
||||
* 2 delay |
||||
*/ |
||||
NONE(0, "none"), |
||||
JUDGE(1, "judge"), |
||||
DELAY(2, "delay"); |
||||
|
||||
ConditionType(int code, String desc) { |
||||
this.code = code; |
||||
this.desc = desc; |
||||
} |
||||
|
||||
@EnumValue |
||||
private final int code; |
||||
private final String desc; |
||||
|
||||
public int getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public String getDesc() { |
||||
return desc; |
||||
} |
||||
} |
@ -0,0 +1,49 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.apache.dolphinscheduler.common.enums; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue; |
||||
|
||||
/** |
||||
* timeout flag |
||||
*/ |
||||
public enum TimeoutFlag { |
||||
/** |
||||
* 0 close |
||||
* 1 open |
||||
*/ |
||||
CLOSE(0, "close"), |
||||
OPEN(1, "open"); |
||||
|
||||
|
||||
TimeoutFlag(int code, String desc){ |
||||
this.code = code; |
||||
this.desc = desc; |
||||
} |
||||
|
||||
@EnumValue |
||||
private final int code; |
||||
private final String desc; |
||||
|
||||
public int getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public String getDesc() { |
||||
return desc; |
||||
} |
||||
} |
@ -0,0 +1,252 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.dao.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.apache.dolphinscheduler.common.enums.ConditionType; |
||||
import org.apache.dolphinscheduler.common.process.Property; |
||||
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* process task relation |
||||
*/ |
||||
@TableName("t_ds_process_task_relation") |
||||
public class ProcessTaskRelation { |
||||
|
||||
/** |
||||
* id |
||||
*/ |
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private int id; |
||||
|
||||
/** |
||||
* name |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* version |
||||
*/ |
||||
private int version; |
||||
|
||||
/** |
||||
* project code |
||||
*/ |
||||
private long projectCode; |
||||
|
||||
/** |
||||
* process code |
||||
*/ |
||||
private long processDefinitionCode; |
||||
|
||||
/** |
||||
* pre project code |
||||
*/ |
||||
private long preProjectCode; |
||||
|
||||
/** |
||||
* pre task code |
||||
*/ |
||||
private long preTaskCode; |
||||
|
||||
/** |
||||
* post project code |
||||
*/ |
||||
private long postProjectCode; |
||||
|
||||
/** |
||||
* post task code |
||||
*/ |
||||
private long postTaskCode; |
||||
|
||||
/** |
||||
* condition type |
||||
*/ |
||||
private ConditionType conditionType; |
||||
|
||||
/** |
||||
* condition parameters |
||||
*/ |
||||
private String conditionParams; |
||||
|
||||
/** |
||||
* condition parameter list |
||||
*/ |
||||
@TableField(exist = false) |
||||
private List<Property> conditionParamList; |
||||
|
||||
/** |
||||
* condition parameter map |
||||
*/ |
||||
@TableField(exist = false) |
||||
private Map<String, String> conditionParamMap; |
||||
|
||||
/** |
||||
* create time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* update time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date updateTime; |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public int getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public String getConditionParams() { |
||||
return conditionParams; |
||||
} |
||||
|
||||
public void setConditionParams(String conditionParams) { |
||||
if (conditionParams == null) { |
||||
this.conditionParamList = new ArrayList<>(); |
||||
} else { |
||||
this.conditionParamList = JSONUtils.toList(conditionParams, Property.class); |
||||
} |
||||
this.conditionParams = conditionParams; |
||||
} |
||||
|
||||
public List<Property> getConditionParamList() { |
||||
return conditionParamList; |
||||
} |
||||
|
||||
public void setConditionParamList(List<Property> conditionParamList) { |
||||
this.conditionParams = JSONUtils.toJsonString(conditionParamList); |
||||
this.conditionParamList = conditionParamList; |
||||
} |
||||
|
||||
public Map<String, String> getConditionParamMap() { |
||||
if (conditionParamMap == null && StringUtils.isNotEmpty(conditionParams)) { |
||||
List<Property> propList = JSONUtils.toList(conditionParams, Property.class); |
||||
conditionParamMap = propList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); |
||||
} |
||||
|
||||
return conditionParamMap; |
||||
} |
||||
|
||||
public void setConditionParamMap(Map<String, String> conditionParamMap) { |
||||
this.conditionParamMap = conditionParamMap; |
||||
} |
||||
|
||||
public int getVersion() { |
||||
return version; |
||||
} |
||||
|
||||
public void setVersion(int version) { |
||||
this.version = version; |
||||
} |
||||
|
||||
public long getProjectCode() { |
||||
return projectCode; |
||||
} |
||||
|
||||
public void setProjectCode(long projectCode) { |
||||
this.projectCode = projectCode; |
||||
} |
||||
|
||||
public long getProcessDefinitionCode() { |
||||
return processDefinitionCode; |
||||
} |
||||
|
||||
public void setProcessDefinitionCode(long processDefinitionCode) { |
||||
this.processDefinitionCode = processDefinitionCode; |
||||
} |
||||
|
||||
public long getPreProjectCode() { |
||||
return preProjectCode; |
||||
} |
||||
|
||||
public void setPreProjectCode(long preProjectCode) { |
||||
this.preProjectCode = preProjectCode; |
||||
} |
||||
|
||||
public long getPreTaskCode() { |
||||
return preTaskCode; |
||||
} |
||||
|
||||
public void setPreTaskCode(long preTaskCode) { |
||||
this.preTaskCode = preTaskCode; |
||||
} |
||||
|
||||
public long getPostProjectCode() { |
||||
return postProjectCode; |
||||
} |
||||
|
||||
public void setPostProjectCode(long postProjectCode) { |
||||
this.postProjectCode = postProjectCode; |
||||
} |
||||
|
||||
public long getPostTaskCode() { |
||||
return postTaskCode; |
||||
} |
||||
|
||||
public void setPostTaskCode(long postTaskCode) { |
||||
this.postTaskCode = postTaskCode; |
||||
} |
||||
|
||||
public ConditionType getConditionType() { |
||||
return conditionType; |
||||
} |
||||
|
||||
public void setConditionType(ConditionType conditionType) { |
||||
this.conditionType = conditionType; |
||||
} |
||||
} |
@ -0,0 +1,279 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.dao.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.apache.dolphinscheduler.common.enums.ConditionType; |
||||
import org.apache.dolphinscheduler.common.process.Property; |
||||
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* process task relation log |
||||
*/ |
||||
@TableName("t_ds_process_task_relation_log") |
||||
public class ProcessTaskRelationLog { |
||||
|
||||
/** |
||||
* id |
||||
*/ |
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private int id; |
||||
|
||||
/** |
||||
* name |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* version |
||||
*/ |
||||
private int version; |
||||
|
||||
/** |
||||
* project code |
||||
*/ |
||||
private long projectCode; |
||||
|
||||
/** |
||||
* process code |
||||
*/ |
||||
private long processDefinitionCode; |
||||
|
||||
/** |
||||
* pre project code |
||||
*/ |
||||
private long preProjectCode; |
||||
|
||||
/** |
||||
* pre task code |
||||
*/ |
||||
private long preTaskCode; |
||||
|
||||
/** |
||||
* post project code |
||||
*/ |
||||
private long postProjectCode; |
||||
|
||||
/** |
||||
* post task code |
||||
*/ |
||||
private long postTaskCode; |
||||
|
||||
/** |
||||
* condition type |
||||
*/ |
||||
private ConditionType conditionType; |
||||
|
||||
/** |
||||
* condition parameters |
||||
*/ |
||||
private String conditionParams; |
||||
|
||||
/** |
||||
* condition parameter list |
||||
*/ |
||||
@TableField(exist = false) |
||||
private List<Property> conditionParamList; |
||||
|
||||
/** |
||||
* condition parameter map |
||||
*/ |
||||
@TableField(exist = false) |
||||
private Map<String, String> conditionParamMap; |
||||
|
||||
/** |
||||
* operator user id |
||||
*/ |
||||
private int operator; |
||||
|
||||
/** |
||||
* operate time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date operateTime; |
||||
|
||||
/** |
||||
* create time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* update time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date updateTime; |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public int getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public String getConditionParams() { |
||||
return conditionParams; |
||||
} |
||||
|
||||
public void setConditionParams(String conditionParams) { |
||||
if (conditionParams == null) { |
||||
this.conditionParamList = new ArrayList<>(); |
||||
} else { |
||||
this.conditionParamList = JSONUtils.toList(conditionParams, Property.class); |
||||
} |
||||
this.conditionParams = conditionParams; |
||||
} |
||||
|
||||
public List<Property> getConditionParamList() { |
||||
return conditionParamList; |
||||
} |
||||
|
||||
public void setConditionParamList(List<Property> conditionParamList) { |
||||
this.conditionParams = JSONUtils.toJsonString(conditionParamList); |
||||
this.conditionParamList = conditionParamList; |
||||
} |
||||
|
||||
public Map<String, String> getConditionParamMap() { |
||||
if (conditionParamMap == null && StringUtils.isNotEmpty(conditionParams)) { |
||||
List<Property> propList = JSONUtils.toList(conditionParams, Property.class); |
||||
conditionParamMap = propList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); |
||||
} |
||||
|
||||
return conditionParamMap; |
||||
} |
||||
|
||||
public void setConditionParamMap(Map<String, String> conditionParamMap) { |
||||
this.conditionParamMap = conditionParamMap; |
||||
} |
||||
|
||||
public int getVersion() { |
||||
return version; |
||||
} |
||||
|
||||
public void setVersion(int version) { |
||||
this.version = version; |
||||
} |
||||
|
||||
public long getProjectCode() { |
||||
return projectCode; |
||||
} |
||||
|
||||
public void setProjectCode(long projectCode) { |
||||
this.projectCode = projectCode; |
||||
} |
||||
|
||||
public long getProcessDefinitionCode() { |
||||
return processDefinitionCode; |
||||
} |
||||
|
||||
public void setProcessDefinitionCode(long processDefinitionCode) { |
||||
this.processDefinitionCode = processDefinitionCode; |
||||
} |
||||
|
||||
public long getPreProjectCode() { |
||||
return preProjectCode; |
||||
} |
||||
|
||||
public void setPreProjectCode(long preProjectCode) { |
||||
this.preProjectCode = preProjectCode; |
||||
} |
||||
|
||||
public long getPreTaskCode() { |
||||
return preTaskCode; |
||||
} |
||||
|
||||
public void setPreTaskCode(long preTaskCode) { |
||||
this.preTaskCode = preTaskCode; |
||||
} |
||||
|
||||
public long getPostProjectCode() { |
||||
return postProjectCode; |
||||
} |
||||
|
||||
public void setPostProjectCode(long postProjectCode) { |
||||
this.postProjectCode = postProjectCode; |
||||
} |
||||
|
||||
public long getPostTaskCode() { |
||||
return postTaskCode; |
||||
} |
||||
|
||||
public void setPostTaskCode(long postTaskCode) { |
||||
this.postTaskCode = postTaskCode; |
||||
} |
||||
|
||||
public ConditionType getConditionType() { |
||||
return conditionType; |
||||
} |
||||
|
||||
public void setConditionType(ConditionType conditionType) { |
||||
this.conditionType = conditionType; |
||||
} |
||||
|
||||
public int getOperator() { |
||||
return operator; |
||||
} |
||||
|
||||
public void setOperator(int operator) { |
||||
this.operator = operator; |
||||
} |
||||
|
||||
public Date getOperateTime() { |
||||
return operateTime; |
||||
} |
||||
|
||||
public void setOperateTime(Date operateTime) { |
||||
this.operateTime = operateTime; |
||||
} |
||||
} |
@ -0,0 +1,359 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.dao.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.apache.dolphinscheduler.common.enums.*; |
||||
import org.apache.dolphinscheduler.common.process.Property; |
||||
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
|
||||
/** |
||||
* task definition |
||||
*/ |
||||
@TableName("t_ds_task_definition") |
||||
public class TaskDefinition { |
||||
|
||||
/** |
||||
* id |
||||
*/ |
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private int id; |
||||
|
||||
/** |
||||
* code |
||||
*/ |
||||
private long code; |
||||
|
||||
/** |
||||
* name |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* version |
||||
*/ |
||||
private int version; |
||||
|
||||
/** |
||||
* description |
||||
*/ |
||||
private String description; |
||||
|
||||
/** |
||||
* project code |
||||
*/ |
||||
private long projectCode; |
||||
|
||||
/** |
||||
* task user id |
||||
*/ |
||||
private int userId; |
||||
|
||||
/** |
||||
* task type |
||||
*/ |
||||
private TaskType taskType; |
||||
|
||||
/** |
||||
* user defined parameters |
||||
*/ |
||||
private String taskParams; |
||||
|
||||
/** |
||||
* user defined parameter list |
||||
*/ |
||||
@TableField(exist = false) |
||||
private List<Property> taskParamList; |
||||
|
||||
/** |
||||
* user define parameter map |
||||
*/ |
||||
@TableField(exist = false) |
||||
private Map<String, String> taskParamMap; |
||||
|
||||
/** |
||||
* task is valid: yes/no |
||||
*/ |
||||
private Flag flag; |
||||
|
||||
/** |
||||
* task priority |
||||
*/ |
||||
private Priority taskPriority; |
||||
|
||||
/** |
||||
* user name |
||||
*/ |
||||
@TableField(exist = false) |
||||
private String userName; |
||||
|
||||
/** |
||||
* project name |
||||
*/ |
||||
@TableField(exist = false) |
||||
private String projectName; |
||||
|
||||
/** |
||||
* worker group |
||||
*/ |
||||
private String workerGroup; |
||||
|
||||
/** |
||||
* fail retry times |
||||
*/ |
||||
private int failRetryTimes; |
||||
|
||||
/** |
||||
* fail retry interval |
||||
*/ |
||||
private int failRetryInterval; |
||||
|
||||
/** |
||||
* timeout flag |
||||
*/ |
||||
private TimeoutFlag timeoutFlag; |
||||
|
||||
/** |
||||
* timeout notify strategy |
||||
*/ |
||||
private TaskTimeoutStrategy taskTimeoutStrategy; |
||||
|
||||
/** |
||||
* task warning time out. unit: minute |
||||
*/ |
||||
private int timeout; |
||||
|
||||
/** |
||||
* create time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* update time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date updateTime; |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public int getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Flag getFlag() { |
||||
return flag; |
||||
} |
||||
|
||||
public void setFlag(Flag flag) { |
||||
this.flag = flag; |
||||
} |
||||
|
||||
public int getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(int userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public String getUserName() { |
||||
return userName; |
||||
} |
||||
|
||||
public void setUserName(String userName) { |
||||
this.userName = userName; |
||||
} |
||||
|
||||
public String getProjectName() { |
||||
return projectName; |
||||
} |
||||
|
||||
public void setProjectName(String projectName) { |
||||
this.projectName = projectName; |
||||
} |
||||
|
||||
public String getTaskParams() { |
||||
return taskParams; |
||||
} |
||||
|
||||
public void setTaskParams(String taskParams) { |
||||
if (taskParams == null) { |
||||
this.taskParamList = new ArrayList<>(); |
||||
} else { |
||||
this.taskParamList = JSONUtils.toList(taskParams, Property.class); |
||||
} |
||||
this.taskParams = taskParams; |
||||
} |
||||
|
||||
public List<Property> getTaskParamList() { |
||||
return taskParamList; |
||||
} |
||||
|
||||
public void setTaskParamList(List<Property> taskParamList) { |
||||
this.taskParams = JSONUtils.toJsonString(taskParamList); |
||||
this.taskParamList = taskParamList; |
||||
} |
||||
|
||||
public Map<String, String> getTaskParamMap() { |
||||
if (taskParamMap == null && StringUtils.isNotEmpty(taskParams)) { |
||||
List<Property> propList = JSONUtils.toList(taskParams, Property.class); |
||||
taskParamMap = propList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); |
||||
} |
||||
|
||||
return taskParamMap; |
||||
} |
||||
|
||||
public void setTaskParamMap(Map<String, String> taskParamMap) { |
||||
this.taskParamMap = taskParamMap; |
||||
} |
||||
|
||||
public int getTimeout() { |
||||
return timeout; |
||||
} |
||||
|
||||
public void setTimeout(int timeout) { |
||||
this.timeout = timeout; |
||||
} |
||||
|
||||
public String getDescription() { |
||||
return description; |
||||
} |
||||
|
||||
public void setDescription(String description) { |
||||
this.description = description; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
|
||||
public long getProjectCode() { |
||||
return projectCode; |
||||
} |
||||
|
||||
public void setProjectCode(long projectCode) { |
||||
this.projectCode = projectCode; |
||||
} |
||||
|
||||
public TaskType getTaskType() { |
||||
return taskType; |
||||
} |
||||
|
||||
public void setTaskType(TaskType taskType) { |
||||
this.taskType = taskType; |
||||
} |
||||
|
||||
public Priority getTaskPriority() { |
||||
return taskPriority; |
||||
} |
||||
|
||||
public void setTaskPriority(Priority taskPriority) { |
||||
this.taskPriority = taskPriority; |
||||
} |
||||
|
||||
public String getWorkerGroup() { |
||||
return workerGroup; |
||||
} |
||||
|
||||
public void setWorkerGroup(String workerGroup) { |
||||
this.workerGroup = workerGroup; |
||||
} |
||||
|
||||
public int getFailRetryTimes() { |
||||
return failRetryTimes; |
||||
} |
||||
|
||||
public void setFailRetryTimes(int failRetryTimes) { |
||||
this.failRetryTimes = failRetryTimes; |
||||
} |
||||
|
||||
public int getFailRetryInterval() { |
||||
return failRetryInterval; |
||||
} |
||||
|
||||
public void setFailRetryInterval(int failRetryInterval) { |
||||
this.failRetryInterval = failRetryInterval; |
||||
} |
||||
|
||||
public TaskTimeoutStrategy getTaskTimeoutStrategy() { |
||||
return taskTimeoutStrategy; |
||||
} |
||||
|
||||
public void setTaskTimeoutStrategy(TaskTimeoutStrategy taskTimeoutStrategy) { |
||||
this.taskTimeoutStrategy = taskTimeoutStrategy; |
||||
} |
||||
|
||||
public TimeoutFlag getTimeoutFlag() { |
||||
return timeoutFlag; |
||||
} |
||||
|
||||
public void setTimeoutFlag(TimeoutFlag timeoutFlag) { |
||||
this.timeoutFlag = timeoutFlag; |
||||
} |
||||
} |
@ -0,0 +1,385 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.dao.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.apache.dolphinscheduler.common.enums.*; |
||||
import org.apache.dolphinscheduler.common.process.Property; |
||||
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* task definition log |
||||
*/ |
||||
@TableName("t_ds_task_definition_log") |
||||
public class TaskDefinitionLog { |
||||
|
||||
/** |
||||
* id |
||||
*/ |
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private int id; |
||||
|
||||
/** |
||||
* code |
||||
*/ |
||||
private long code; |
||||
|
||||
/** |
||||
* name |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* version |
||||
*/ |
||||
private int version; |
||||
|
||||
/** |
||||
* description |
||||
*/ |
||||
private String description; |
||||
|
||||
/** |
||||
* project code |
||||
*/ |
||||
private long projectCode; |
||||
|
||||
/** |
||||
* task user id |
||||
*/ |
||||
private int userId; |
||||
|
||||
/** |
||||
* task type |
||||
*/ |
||||
private TaskType taskType; |
||||
|
||||
/** |
||||
* user defined parameters |
||||
*/ |
||||
private String taskParams; |
||||
|
||||
/** |
||||
* user defined parameter list |
||||
*/ |
||||
@TableField(exist = false) |
||||
private List<Property> taskParamList; |
||||
|
||||
/** |
||||
* user define parameter map |
||||
*/ |
||||
@TableField(exist = false) |
||||
private Map<String, String> taskParamMap; |
||||
|
||||
/** |
||||
* task is valid: yes/no |
||||
*/ |
||||
private Flag flag; |
||||
|
||||
/** |
||||
* task priority |
||||
*/ |
||||
private Priority taskPriority; |
||||
|
||||
/** |
||||
* user name |
||||
*/ |
||||
@TableField(exist = false) |
||||
private String userName; |
||||
|
||||
/** |
||||
* project name |
||||
*/ |
||||
@TableField(exist = false) |
||||
private String projectName; |
||||
|
||||
/** |
||||
* worker group |
||||
*/ |
||||
private String workerGroup; |
||||
|
||||
/** |
||||
* fail retry times |
||||
*/ |
||||
private int failRetryTimes; |
||||
|
||||
/** |
||||
* fail retry interval |
||||
*/ |
||||
private int failRetryInterval; |
||||
|
||||
/** |
||||
* timeout flag |
||||
*/ |
||||
private TimeoutFlag timeoutFlag; |
||||
|
||||
/** |
||||
* timeout notify strategy |
||||
*/ |
||||
private TaskTimeoutStrategy taskTimeoutStrategy; |
||||
|
||||
/** |
||||
* task warning time out. unit: minute |
||||
*/ |
||||
private int timeout; |
||||
|
||||
/** |
||||
* operator user id |
||||
*/ |
||||
private int operator; |
||||
|
||||
/** |
||||
* operate time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date operateTime; |
||||
|
||||
/** |
||||
* create time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* update time |
||||
*/ |
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
private Date updateTime; |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public int getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(int id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Flag getFlag() { |
||||
return flag; |
||||
} |
||||
|
||||
public void setFlag(Flag flag) { |
||||
this.flag = flag; |
||||
} |
||||
|
||||
public int getUserId() { |
||||
return userId; |
||||
} |
||||
|
||||
public void setUserId(int userId) { |
||||
this.userId = userId; |
||||
} |
||||
|
||||
public String getUserName() { |
||||
return userName; |
||||
} |
||||
|
||||
public void setUserName(String userName) { |
||||
this.userName = userName; |
||||
} |
||||
|
||||
public String getProjectName() { |
||||
return projectName; |
||||
} |
||||
|
||||
public void setProjectName(String projectName) { |
||||
this.projectName = projectName; |
||||
} |
||||
|
||||
public String getTaskParams() { |
||||
return taskParams; |
||||
} |
||||
|
||||
public void setTaskParams(String taskParams) { |
||||
if (taskParams == null) { |
||||
this.taskParamList = new ArrayList<>(); |
||||
} else { |
||||
this.taskParamList = JSONUtils.toList(taskParams, Property.class); |
||||
} |
||||
this.taskParams = taskParams; |
||||
} |
||||
|
||||
public List<Property> getTaskParamList() { |
||||
return taskParamList; |
||||
} |
||||
|
||||
public void setTaskParamList(List<Property> taskParamList) { |
||||
this.taskParams = JSONUtils.toJsonString(taskParamList); |
||||
this.taskParamList = taskParamList; |
||||
} |
||||
|
||||
public Map<String, String> getTaskParamMap() { |
||||
if (taskParamMap == null && StringUtils.isNotEmpty(taskParams)) { |
||||
List<Property> propList = JSONUtils.toList(taskParams, Property.class); |
||||
taskParamMap = propList.stream().collect(Collectors.toMap(Property::getProp, Property::getValue)); |
||||
} |
||||
|
||||
return taskParamMap; |
||||
} |
||||
|
||||
public void setTaskParamMap(Map<String, String> taskParamMap) { |
||||
this.taskParamMap = taskParamMap; |
||||
} |
||||
|
||||
public int getTimeout() { |
||||
return timeout; |
||||
} |
||||
|
||||
public void setTimeout(int timeout) { |
||||
this.timeout = timeout; |
||||
} |
||||
|
||||
public String getDescription() { |
||||
return description; |
||||
} |
||||
|
||||
public void setDescription(String description) { |
||||
this.description = description; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
|
||||
public long getProjectCode() { |
||||
return projectCode; |
||||
} |
||||
|
||||
public void setProjectCode(long projectCode) { |
||||
this.projectCode = projectCode; |
||||
} |
||||
|
||||
public TaskType getTaskType() { |
||||
return taskType; |
||||
} |
||||
|
||||
public void setTaskType(TaskType taskType) { |
||||
this.taskType = taskType; |
||||
} |
||||
|
||||
public Priority getTaskPriority() { |
||||
return taskPriority; |
||||
} |
||||
|
||||
public void setTaskPriority(Priority taskPriority) { |
||||
this.taskPriority = taskPriority; |
||||
} |
||||
|
||||
public String getWorkerGroup() { |
||||
return workerGroup; |
||||
} |
||||
|
||||
public void setWorkerGroup(String workerGroup) { |
||||
this.workerGroup = workerGroup; |
||||
} |
||||
|
||||
public int getFailRetryTimes() { |
||||
return failRetryTimes; |
||||
} |
||||
|
||||
public void setFailRetryTimes(int failRetryTimes) { |
||||
this.failRetryTimes = failRetryTimes; |
||||
} |
||||
|
||||
public int getFailRetryInterval() { |
||||
return failRetryInterval; |
||||
} |
||||
|
||||
public void setFailRetryInterval(int failRetryInterval) { |
||||
this.failRetryInterval = failRetryInterval; |
||||
} |
||||
|
||||
public TaskTimeoutStrategy getTaskTimeoutStrategy() { |
||||
return taskTimeoutStrategy; |
||||
} |
||||
|
||||
public void setTaskTimeoutStrategy(TaskTimeoutStrategy taskTimeoutStrategy) { |
||||
this.taskTimeoutStrategy = taskTimeoutStrategy; |
||||
} |
||||
|
||||
public int getOperator() { |
||||
return operator; |
||||
} |
||||
|
||||
public void setOperator(int operator) { |
||||
this.operator = operator; |
||||
} |
||||
|
||||
public Date getOperateTime() { |
||||
return operateTime; |
||||
} |
||||
|
||||
public void setOperateTime(Date operateTime) { |
||||
this.operateTime = operateTime; |
||||
} |
||||
|
||||
public TimeoutFlag getTimeoutFlag() { |
||||
return timeoutFlag; |
||||
} |
||||
|
||||
public void setTimeoutFlag(TimeoutFlag timeoutFlag) { |
||||
this.timeoutFlag = timeoutFlag; |
||||
} |
||||
} |
Loading…
Reference in new issue