Skip to content

Commit

Permalink
feature: 原子操作能力支持滚动执行 TencentBlueKing#446
Browse files Browse the repository at this point in the history
定义web API
  • Loading branch information
wangyu096 committed Dec 14, 2021
1 parent d95a164 commit 2460b84
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
build
release

**/bin
**/bin
.codecc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import com.tencent.bk.job.execute.model.web.vo.ExecuteTargetVO;
import com.tencent.bk.job.execute.model.web.vo.RollingExecutionConfigVO;
import com.tencent.bk.job.execute.model.web.vo.RollingConfigVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
Expand Down Expand Up @@ -103,6 +103,6 @@ public class WebFastExecuteScriptRequest {
private Long taskInstanceId;

@ApiModelProperty(value = "滚动配置")
private RollingExecutionConfigVO rollingExecutionConfig;
private RollingConfigVO rollingExecutionConfig;

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.tencent.bk.job.execute.common.constants.FileTransferModeEnum;
import com.tencent.bk.job.execute.model.web.vo.ExecuteFileDestinationInfoVO;
import com.tencent.bk.job.execute.model.web.vo.ExecuteFileSourceInfoVO;
import com.tencent.bk.job.execute.model.web.vo.RollingExecutionConfigVO;
import com.tencent.bk.job.execute.model.web.vo.RollingConfigVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
Expand Down Expand Up @@ -77,7 +77,7 @@ public class WebFastPushFileRequest {
private Integer timeout;

@ApiModelProperty(value = "滚动配置")
private RollingExecutionConfigVO rollingExecutionConfig;
private RollingConfigVO rollingExecutionConfig;

/**
* 传输模式
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,24 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@ApiModel("滚动执行配置VO")
@Data
public class RollingExecutionConfigVO {
@ApiModelProperty(value = "滚动策略表达式")
private String rollingExpr;
public class RollingConfigVO {
@ApiModelProperty(value = "滚动区间名称")
private String name;

@ApiModelProperty(value = "滚动分批策略表达式")
private String batchExpr;

@ApiModelProperty(value = "滚动机制,1-执行失败则暂停;2-忽略失败,自动滚动下一批;3-人工确认")
private Integer mode;

@ApiModelProperty(value = "滚动区间包含的所有步骤ID,步骤ID按照滚动先后排序")
private List<Long> includeStepIdList;

@ApiModelProperty(value = "分批滚动的步骤,步骤ID按照滚动先后排序")
private List<Long> rollingStepIdList;

@ApiModelProperty(value = "滚动机制,1-执行失败则暂停;2-执行成功,自动滚动下一批;3-忽略失败,自动滚动下一批;4-人工确认")
private Integer rollingMode;
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,23 @@ CREATE TABLE IF NOT EXISTS `gse_task_log`
(
`step_instance_id` bigint(20) NOT NULL DEFAULT '0',
`execute_count` int(11) NOT NULL DEFAULT '0',
`batch` smallint(6) NOT NULL DEFAULT '0',
`start_time` bigint(20) DEFAULT NULL,
`end_time` bigint(20) DEFAULT NULL,
`total_time` bigint(11) DEFAULT NULL,
`status` tinyint(4) DEFAULT '1',
`gse_task_id` varchar(64) DEFAULT NULL,
`row_create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`row_update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`step_instance_id`, `execute_count`)
PRIMARY KEY (`step_instance_id`, `execute_count`, `batch`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;

CREATE TABLE IF NOT EXISTS `gse_task_ip_log`
(
`step_instance_id` bigint(20) NOT NULL,
`execute_count` int(11) NOT NULL DEFAULT '0',
`batch` smallint(6) NOT NULL DEFAULT '0',
`ip` varchar(30) NOT NULL,
`status` int(11) DEFAULT '1',
`start_time` bigint(20) DEFAULT NULL,
Expand Down Expand Up @@ -262,3 +264,35 @@ CREATE TABLE IF NOT EXISTS `step_instance_variable`
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;

CREATE TABLE IF NOT EXISTS `step_instance_rolling_task`
(
`step_instance_id` bigint(20) NOT NULL DEFAULT '0',
`batch` smallint(6) NOT NULL DEFAULT '0',
`execute_count` int(11) NOT NULL DEFAULT '0',
`start_time` bigint(20) DEFAULT NULL,
`end_time` bigint(20) DEFAULT NULL,
`total_time` bigint(11) DEFAULT NULL,
`status` tinyint(4) DEFAULT '1',
`batch_detail` varchar(64) DEFAULT NULL,
`row_create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`row_update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`step_instance_id`, `batch`, `execute_count`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;

CREATE TABLE IF NOT EXISTS `step_instance_task`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`step_instance_id` bigint(20) NOT NULL DEFAULT '0',
`execute_count` tinyint(4) NOT NULL DEFAULT '0',
`batch` smallint(6) NOT NULL DEFAULT '0',
`start_time` bigint(20) DEFAULT NULL,
`end_time` bigint(20) DEFAULT NULL,
`total_time` bigint(11) DEFAULT NULL,
`status` tinyint(4) NOT NULL DEFAULT '1',
`row_create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`row_update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`step_instance_id`, `execute_count`, `batch`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4;

0 comments on commit 2460b84

Please sign in to comment.