海豚调度|项目、工作流、任务相关元数据梳理

本文围绕海豚调度,介绍了项目、工作流、任务相关元数据。阐述了项目表、工作流定义表等各表的唯一键、字段含义,以及工作流与任务的关系表中任务依赖关系的记录方式,还提及了工作流实例表和任务实例表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 项目(Project)、工作流(Process)、任务(Task)相关元数据

海豚调度元数据的源代码位置:Github

1.1 项目

1.1.1 项目表:t_ds_project
字段名字段类型字段含义
idint(11)自增主键(页面位置:Project > Project List > #)
namevarchar(255)项目名称(页面位置:Project > Project List > Project Name)
codebigint(20)项目 ID(项目页面 url 的末尾部分)
descriptionvarchar(255)项目描述(页面位置:Project > Project List > Description)
user_idint(11)所属用户(页面位置:Project > Project List > Owned Users)
flagtinyint(4)状态
create_timedatetime创建时间(页面位置:Project > Project List > Create Time)
update_timedatetime更新时间(页面位置:Project > Project List > Update Time)
CREATE TABLE `t_ds_project` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  `name` varchar(255) DEFAULT NULL COMMENT 'project name',
  `code` bigint(20) NOT NULL COMMENT 'encoding',
  `description` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL COMMENT 'creator id',
  `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available',
  `create_time` datetime NOT NULL COMMENT 'create time',
  `update_time` datetime DEFAULT NULL COMMENT 'update time',
  PRIMARY KEY (`id`),
  KEY `user_id_index` (`user_id`) USING BTREE,
  UNIQUE KEY `unique_name`(`name`),
  UNIQUE KEY `unique_code`(`code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

唯一键为项目名称(name)和项目编码(code)。

1.1.2 项目的用户权限表:t_ds_relation_project_user
字段名字段类型字段含义
idint(11)自增主键
user_idint(11)用户 ID
project_idint(11)项目 ID(对应 t_ds_project 表的 code 字段)
permint(11)权限信息
create_timedatetime创建时间
update_timedatetime更新时间
CREATE TABLE `t_ds_relation_project_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  `user_id` int(11) NOT NULL COMMENT 'user id',
  `project_id` int(11) DEFAULT NULL COMMENT 'project id',
  `perm` int(11) DEFAULT '1' COMMENT 'limits of authority',
  `create_time` datetime DEFAULT NULL COMMENT 'create time',
  `update_time` datetime DEFAULT NULL COMMENT 'update time',
  PRIMARY KEY (`id`),
  UNIQUE KEY uniq_uid_pid(user_id,project_id)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

1.2 工作流

1.2.1 工作流定义表:t_ds_process_definition
字段名字段类型字段含义
idint(11)自增主键
codeint(11)工作流定义 ID(工作流页面 url 的末尾部分)
namevarchar(255)工作流定义名称(页面位置:Project > Workflow > Workflow Definition > Workflow Name)
versionint(11)工作流定义版本
descriptiontext工作流定义描述(页面位置:Project > Workflow > Workflow Definition > Description)
project_codebigint(20)所属项目 ID
release_statetinyint(4)工作流定义发布状态
user_idint(11)工作流定义创建者(页面位置:Project > Workflow > Workflow Definition > Create User)
global_paramstext工作流定义全局参数
locationstext工作流定义各任务坐标
warning_group_idint(11)工作流定义告警组
timeoutint(11)工作流定义超时时间
execution_typetinyint(4)工作流定义执行类型
create_timedatetime创建时间(页面位置:Project > Workflow > Workflow Definition > Create Time)
update_timedatetime更新时间(页面位置:Project > Workflow > Workflow Definition > Update Time)
CREATE TABLE `t_ds_process_definition` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  `code` bigint(20) NOT NULL COMMENT 'encoding',
  `name` varchar(255) DEFAULT NULL COMMENT 'process definition name',
  `version` int(11) NOT NULL DEFAULT '1' COMMENT 'process definition version',
  `description` text COMMENT 'description',
  `project_code` bigint(20) NOT NULL COMMENT 'project code',
  `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online',
  `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id',
  `global_params` text COMMENT 'global parameters',
  `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available',
  `locations` text COMMENT 'Node location information',
  `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  `timeout` int(11) DEFAULT '0' COMMENT 'time out, unit: minute',
  `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority',
  `create_time` datetime NOT NULL COMMENT 'create time',
  `update_time` datetime NOT NULL COMMENT 'update time',
  PRIMARY KEY (`id`,`code`),
  UNIQUE KEY `process_unique` (`name`,`project_code`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

因为唯一键为 nameproject_code,即所属项目 ID 和工作流名称共同构成唯一键,所以在每个项目中,工作流名称是唯一的。

因为在每个任务流中都维护了项目 ID,所以每个任务流是有唯一所属的项目的。

1.2.2 工作流定义历史表:t_ds_process_definition_log

字段含义与工作流定义表相同。

CREATE TABLE `t_ds_process_definition_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  `code` bigint(20) NOT NULL COMMENT 'encoding',
  `name` varchar(255) DEFAULT NULL COMMENT 'process definition name',
  `version` int(11) NOT NULL DEFAULT '1' COMMENT 'process definition version',
  `description` text COMMENT 'description',
  `project_code` bigint(20) NOT NULL COMMENT 'project code',
  `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online',
  `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id',
  `global_params` text COMMENT 'global parameters',
  `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available',
  `locations` text COMMENT 'Node location information',
  `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id',
  `timeout` int(11) DEFAULT '0' COMMENT 'time out,unit: minute',
  `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority',
  `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  `create_time` datetime NOT NULL COMMENT 'create time',
  `update_time` datetime NOT NULL COMMENT 'update time',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_idx_code_version` (`code`,`version`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

1.3 任务

1.3.1 任务定义表(Task)
字段名字段类型字段含义
idint(11)自增主键
codeint(11)任务定义 ID(工作流页面 url 的末尾部分)
namevarchar(255)任务定义名称(页面位置:Project > Task > Task Definition > Task Name)
versionint(11)任务定义版本(页面位置:Project > Task > Task Definition > Task Version)
descriptiontext任务定义描述
project_codebigint(20)所属项目 ID
user_idint(11)任务定义创建者
task_typevarchar(50)任务定义的类型
task_execute_typeint(11)任务定义的执行类型
task_paramslongtext任务定义的参数
flagtinyint(2)
is_cachetinyint(2)
worker_groupvarchar(255)任务定义使用的 Worker 分组
environment_codebigint(20)任务定义使用的环境 ID
fail_retry_timesint(11)失败重试次数
fail_retry_intervalint(11)失败重试间隔
timeout_flagtinyint(2)超时告警标记:0 = 关闭,1 = 开启
timeout_notify_strategytinyint(4)超时告警策略
delay_timeint(11)延时执行时间
resourece_idstext任务定义依赖的字段 ID 的列表,用逗号分隔
task_group_idint(11)任务组 ID
task_group_prioritytinyint(4)任务组优先级
cpu_quotaint(11)CPU 配额
memory_maxint(11)最大内存
create_timedatetime创建时间
update_timedatetime更新时间
CREATE TABLE `t_ds_task_definition` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  `code` bigint(20) NOT NULL COMMENT 'encoding',
  `name` varchar(255) DEFAULT NULL COMMENT 'task definition name',
  `version` int(11) NOT NULL DEFAULT '1' COMMENT 'task definition version',
  `description` text COMMENT 'description',
  `project_code` bigint(20) NOT NULL COMMENT 'project code',
  `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id',
  `task_type` varchar(50) NOT NULL COMMENT 'task type',
  `task_execute_type` int(11) DEFAULT '0' COMMENT 'task execute type: 0-batch, 1-stream',
  `task_params` longtext COMMENT 'job custom parameters',
  `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available',
  `is_cache` tinyint(2) DEFAULT '0' COMMENT '0 not available, 1 available',
  `task_priority` tinyint(4) DEFAULT '2' COMMENT 'job priority',
  `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker grouping',
  `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries',
  `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval',
  `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open',
  `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
  `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
  `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
  `resource_ids` text COMMENT 'resource id, separated by comma',
  `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id',
  `task_group_priority` tinyint(4) DEFAULT '0' COMMENT 'task group priority',
  `cpu_quota` int(11) DEFAULT '-1' NOT NULL COMMENT 'cpuQuota(%): -1:Infinity',
  `memory_max` int(11) DEFAULT '-1' NOT NULL COMMENT 'MemoryMax(MB): -1:Infinity',
  `create_time` datetime NOT NULL COMMENT 'create time',
  `update_time` datetime NOT NULL COMMENT 'update time',
  PRIMARY KEY (`id`,`code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

在任务表里,只有所属的 project_code,但没有所属的 process_code,工作流和任务的依赖关系是通过 t_ds_process_task_relation 表维护的。

在任务表中,如果任务是依赖其他工作流中的任务,则其 task_typeDEPENDENT,其 task_params["dependence"]["dependItemList"] 中会包含它的依赖。

1.3.2 任务定义历史表:t_ds_task_definition_log

字段含义与任务定义表相同。

CREATE TABLE `t_ds_task_definition_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  `code` bigint(20) NOT NULL COMMENT 'encoding',
  `name` varchar(255) DEFAULT NULL COMMENT 'task definition name',
  `version` int(11) NOT NULL DEFAULT '1' COMMENT 'task definition version',
  `description` text COMMENT 'description',
  `project_code` bigint(20) NOT NULL COMMENT 'project code',
  `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id',
  `task_type` varchar(50) NOT NULL COMMENT 'task type',
  `task_execute_type` int(11) DEFAULT '0' COMMENT 'task execute type: 0-batch, 1-stream',
  `task_params` longtext COMMENT 'job custom parameters',
  `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available',
  `is_cache` tinyint(2) DEFAULT '0' COMMENT '0 not available, 1 available',
  `task_priority` tinyint(4) DEFAULT '2' COMMENT 'job priority',
  `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker grouping',
  `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries',
  `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval',
  `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open',
  `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
  `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
  `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
  `resource_ids` text DEFAULT NULL COMMENT 'resource id, separated by comma',
  `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id',
  `task_group_priority` tinyint(4) DEFAULT 0 COMMENT 'task group priority',
  `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  `cpu_quota` int(11) DEFAULT '-1' NOT NULL COMMENT 'cpuQuota(%): -1:Infinity',
  `memory_max` int(11) DEFAULT '-1' NOT NULL COMMENT 'MemoryMax(MB): -1:Infinity',
  `create_time` datetime NOT NULL COMMENT 'create time',
  `update_time` datetime NOT NULL COMMENT 'update time',
  PRIMARY KEY (`id`),
  KEY `idx_code_version` (`code`,`version`),
  KEY `idx_project_code` (`project_code`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

1.4 工作流与任务的关系

1.4.1 工作流与任务的关系表:t_ds_process_task_relation
段名字段类型字段含义
idint(11)自增主键
namevarchar(255)连接名称
project_codebigint(20)所属项目 ID
process_definition_codebigint(20)所属工作流定义 ID
process_definition_versionint(11)所属工作流定义版本
pre_task_codebigint(20)上游任务定义的 ID(如果下游任务定义没有上游任务,则为 0)
pre_task_versionint(11)上游任务定义版本
post_task_codebigint(20)下游任务定义的 ID
post_task_versionint(11)下游任务定义版本
condition_typetinyint(2)条件类型:0 = none,1 = judge,2 = delay
condition_paramstext条件参数
create_timedatetime创建时间
update_timedatetime更新时间
CREATE TABLE `t_ds_process_task_relation` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  `name` varchar(255) DEFAULT NULL COMMENT 'relation name',
  `project_code` bigint(20) NOT NULL COMMENT 'project code',
  `process_definition_code` bigint(20) NOT NULL COMMENT 'process code',
  `process_definition_version` int(11) NOT NULL COMMENT 'process version',
  `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code',
  `pre_task_version` int(11) NOT NULL COMMENT 'pre task version',
  `post_task_code` bigint(20) NOT NULL COMMENT 'post task code',
  `post_task_version` int(11) NOT NULL COMMENT 'post task version',
  `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay',
  `condition_params` text COMMENT 'condition params(json)',
  `create_time` datetime NOT NULL COMMENT 'create time',
  `update_time` datetime NOT NULL COMMENT 'update time',
  PRIMARY KEY (`id`),
  KEY `idx_code` (`project_code`,`process_definition_code`),
  KEY `idx_pre_task_code_version` (`pre_task_code`,`pre_task_version`),
  KEY `idx_post_task_code_version` (`post_task_code`,`post_task_version`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

在这个表中,记录了工作流中每一个任务的上游以及其中 process_definition_code 为工作流的编码。其中的每一条记录,是不同任务(Task)之间的一个依赖关系,具体地:

  • 如果一个任务没有上游依赖,那么会有一条 pre_task_code0 的记录
  • 如果一个任务有多个上游依赖,那么会有多条 pre_task_code 不同单 post_task_code 相同的记录
1.4.2 工作流与任务的关系历史表:t_ds_process_task_relation_log

字段含义与工作流与任务的关系表相同。

CREATE TABLE `t_ds_process_task_relation_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id',
  `name` varchar(255) DEFAULT NULL COMMENT 'relation name',
  `project_code` bigint(20) NOT NULL COMMENT 'project code',
  `process_definition_code` bigint(20) NOT NULL COMMENT 'process code',
  `process_definition_version` int(11) NOT NULL COMMENT 'process version',
  `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code',
  `pre_task_version` int(11) NOT NULL COMMENT 'pre task version',
  `post_task_code` bigint(20) NOT NULL COMMENT 'post task code',
  `post_task_version` int(11) NOT NULL COMMENT 'post task version',
  `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay',
  `condition_params` text COMMENT 'condition params(json)',
  `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
  `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
  `create_time` datetime NOT NULL COMMENT 'create time',
  `update_time` datetime NOT NULL COMMENT 'update time',
  PRIMARY KEY (`id`),
  KEY `idx_process_code_version` (`process_definition_code`,`process_definition_version`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

1.5 工作流实例表:t_ds_process_instance

段名字段类型字段含义
idint(11)自增主键
namevarchar(255)工作流实例名称
process_definition_codebigint(20)所属工作流定义 ID
process_definition_versionint(11)所属工作流定义版本
project_codebigint(20)所属项目 ID
statetinyint(4)状态:0 = 已提交,1 = 运行中,2 = 准备暂停,3 = 暂停,4 = 准备停止,5 = 停止,6 = 失败,7 = 成功,8 = 需要容错,9 = KILL,10 = 等待线程,11 = 等待依赖完成
state_historytext历史状态描述
recoverytinyint(4)实例容错状态:0 = 正常,1 = 容错实例
start_timedatetime工作流实例开始时间
end_timedatetime工作流实例结束时间
run_timesint(11)工作流实例运行次数
hostvarchar(135)工作流实例运行 host
command_typetinyint(4)任务类型
command_paramtext任务参数
task_depend_typetinyint(4)任务依赖类型:0 = only current node,1 = before the node,2 = later nodes
max_try_timestinyint(4)最大尝试次数
failure_strategytinyint(4)失败策略:0 = end the process when node failed,1 = continue running the other nodes when node failed
warning_typetinyint(4)告警类型:0 = no warning、1 = warning if process success,2 = warning if process
warning_group_idint(11)告警组 ID
schedule_timedatetime调度运行时间
command_start_timedatetime命令开始时间
global_paramstext全局参数
flag
update_timetimestamp更新时间
is_sub_processint(11)是否为子工作流实例的标记
executor_idint(11)Executor ID
executor_namevarchar(64)Executor 用户名
history_cmdtext工作流实例的历史命令
process_instance_priorityint(11)工作流实例的优先级
worker_groupvarchar(255)Worker 分组
environment_codebigint(20)工作流实例使用的环境 ID
timeoutint(11)超时时间
tenant_codevarchar(64)tenant code
var_poollongtextvar_pool
dry_runtinyint(4)dry run flag:0 normal, 1 dry run
next_process_instance_idint(11)serial queue next processInstanceId
restart_timedatetime工作流实例重启时间
test_flagtinyint(4)测试标记:0 = 正常,1 = 测试
CREATE TABLE `t_ds_process_instance` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  `name` varchar(255) DEFAULT NULL COMMENT 'process instance name',
  `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code',
  `process_definition_version` int(11) NOT NULL DEFAULT '1' COMMENT 'process definition version',
  `project_code` bigint(20) DEFAULT NULL COMMENT 'project code',
  `state` tinyint(4) DEFAULT NULL COMMENT 'process instance Status: 0 commit succeeded, 1 running, 2 prepare to pause, 3 pause, 4 prepare to stop, 5 stop, 6 fail, 7 succeed, 8 need fault tolerance, 9 kill, 10 wait for thread, 11 wait for dependency to complete',
  `state_history` text DEFAULT NULL COMMENT 'state history desc',
  `recovery` tinyint(4) DEFAULT NULL COMMENT 'process instance failover flag:0:normal,1:failover instance',
  `start_time` datetime DEFAULT NULL COMMENT 'process instance start time',
  `end_time` datetime DEFAULT NULL COMMENT 'process instance end time',
  `run_times` int(11) DEFAULT NULL COMMENT 'process instance run times',
  `host` varchar(135) DEFAULT NULL COMMENT 'process instance host',
  `command_type` tinyint(4) DEFAULT NULL COMMENT 'command type',
  `command_param` text COMMENT 'json command parameters',
  `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'task depend type. 0: only current node,1:before the node,2:later nodes',
  `max_try_times` tinyint(4) DEFAULT '0' COMMENT 'max try times',
  `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'failure strategy. 0:end the process when node failed,1:continue running the other nodes when node failed',
  `warning_type` tinyint(4) DEFAULT '0' COMMENT 'warning type. 0:no warning,1:warning if process success,2:warning if process failed,3:warning if success',
  `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group id',
  `schedule_time` datetime DEFAULT NULL COMMENT 'schedule time',
  `command_start_time` datetime DEFAULT NULL COMMENT 'command start time',
  `global_params` text COMMENT 'global parameters',
  `flag` tinyint(4) DEFAULT '1' COMMENT 'flag',
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_sub_process` int(11) DEFAULT '0' COMMENT 'flag, whether the process is sub process',
  `executor_id` int(11) NOT NULL COMMENT 'executor id',
  `executor_name` varchar(64) DEFAULT NULL COMMENT 'execute user name',
  `history_cmd` text COMMENT 'history commands of process instance operation',
  `process_instance_priority` int(11) DEFAULT '2' COMMENT 'process instance priority. 0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker group id',
  `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  `timeout` int(11) DEFAULT '0' COMMENT 'time out',
  `tenant_code` varchar(64) DEFAULT 'default' COMMENT 'tenant code',
  `var_pool` longtext COMMENT 'var_pool',
  `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run',
  `next_process_instance_id` int(11) DEFAULT '0' COMMENT 'serial queue next processInstanceId',
  `restart_time` datetime DEFAULT NULL COMMENT 'process instance restart time',
  `test_flag`  tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run',
  PRIMARY KEY (`id`),
  KEY `process_instance_index` (`process_definition_code`,`id`) USING BTREE,
  KEY `start_time_index` (`start_time`,`end_time`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;

1.6 任务实例表:t_ds_task_instance

段名字段类型字段含义
idint(11)自增主键
namevarchar(255)任务实例名称
task_typevarchar(50)任务实例类型
task_execute_typeint(11)任务实例执行类型:0 = 批,1 = 流
task_codebigint(20)对应任务定义 ID
task_definition_versionint(11)对应任务定义版本
process_instance_idint(11)对应工作流实例 ID
process_instance_namevarchar(255)对应工作流实例名称
project_codebigint(20)所属项目 ID
statetinyint(4)任务实例当前状态:0 = 已提交,1 = 运行中,2 = 准备暂停,3 = 暂停,4 = 准备停止,5 = 停止,6 = 失败,7 = 成功,8 = 需要容错,9 = KILL,10 = 等待线程,11 = 等待依赖完成
submit_timedatetime任务提交时间
start_timedatetime任务开始时间
end_timedatetime任务结束时间
hostvarchar(135)任务执行的服务器 HOST
execute_pathvarchar(200)任务执行的服务器路径
log_pathlongtext任务的日志路径
alert_flagtinyint(4)告警标记
retry_timesint(4)重试次数
pidint(4)任务的进程号
app_linktextYarn 的 app id
task_paramslongtext任务执行的自定义参数
flagtinyint(1)0 = 不可获得,1 = 可获得
is_cachetinyint(2)0 = 不可获得,1 =可获得
cache_keyvarchar(200)cache_key
retry_intervalint(4)任务失败后的重试间隔
max_retry_timesint(2)最大重试次数
task_instance_priorityint(11)任务实例优先级:0 = Higeest、1 = High、2 = Medium、3 = Low、4 = Lowest
worker_groupvarchar(255)Worker 分组
environment_codebigint(20)使用的环境 ID
environment_configtext使用的环境配置
executor_idint(11)
executor_namevarchar(64)
first_submit_timedatetime任务的首次提交时间
delay_timeint(4)task delay execution time
var_poollongtextvar_pool
task_group_idint(11)任务组 ID
dry runtinyint(4)dry run flag: 0 normal, 1 dry run
cpu_quotaint(11)CPU 配额:-1 = 无限制
memory_maxint(11)内存限制:-1 = 无限制
test_flagtinyint(4)测试标记:0 = 正常,1 = 测试
CREATE TABLE `t_ds_task_instance` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key',
  `name` varchar(255) DEFAULT NULL COMMENT 'task name',
  `task_type` varchar(50) NOT NULL COMMENT 'task type',
  `task_execute_type` int(11) DEFAULT '0' COMMENT 'task execute type: 0-batch, 1-stream',
  `task_code` bigint(20) NOT NULL COMMENT 'task definition code',
  `task_definition_version` int(11) NOT NULL DEFAULT '1' COMMENT 'task definition version',
  `process_instance_id` int(11) DEFAULT NULL COMMENT 'process instance id',
  `process_instance_name` varchar(255) DEFAULT NULL COMMENT 'process instance name',
  `project_code` bigint(20) DEFAULT NULL COMMENT 'project code',
  `state` tinyint(4) DEFAULT NULL COMMENT 'Status: 0 commit succeeded, 1 running, 2 prepare to pause, 3 pause, 4 prepare to stop, 5 stop, 6 fail, 7 succeed, 8 need fault tolerance, 9 kill, 10 wait for thread, 11 wait for dependency to complete',
  `submit_time` datetime DEFAULT NULL COMMENT 'task submit time',
  `start_time` datetime DEFAULT NULL COMMENT 'task start time',
  `end_time` datetime DEFAULT NULL COMMENT 'task end time',
  `host` varchar(135) DEFAULT NULL COMMENT 'host of task running on',
  `execute_path` varchar(200) DEFAULT NULL COMMENT 'task execute path in the host',
  `log_path` longtext DEFAULT NULL COMMENT 'task log path',
  `alert_flag` tinyint(4) DEFAULT NULL COMMENT 'whether alert',
  `retry_times` int(4) DEFAULT '0' COMMENT 'task retry times',
  `pid` int(4) DEFAULT NULL COMMENT 'pid of task',
  `app_link` text COMMENT 'yarn app id',
  `task_params` longtext COMMENT 'job custom parameters',
  `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available',
  `is_cache` tinyint(2) DEFAULT '0' COMMENT '0 not available, 1 available',
  `cache_key` varchar(200) DEFAULT NULL COMMENT 'cache_key',
  `retry_interval` int(4) DEFAULT NULL COMMENT 'retry interval when task failed ',
  `max_retry_times` int(2) DEFAULT NULL COMMENT 'max retry times',
  `task_instance_priority` int(11) DEFAULT NULL COMMENT 'task instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest',
  `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker group id',
  `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
  `environment_config` text COMMENT 'this config contains many environment variables config',
  `executor_id` int(11) DEFAULT NULL,
  `executor_name` varchar(64) DEFAULT NULL,
  `first_submit_time` datetime DEFAULT NULL COMMENT 'task first submit time',
  `delay_time` int(4) DEFAULT '0' COMMENT 'task delay execution time',
  `var_pool` longtext COMMENT 'var_pool',
  `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id',
  `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag: 0 normal, 1 dry run',
  `cpu_quota` int(11) DEFAULT '-1' NOT NULL COMMENT 'cpuQuota(%): -1:Infinity',
  `memory_max` int(11) DEFAULT '-1' NOT NULL COMMENT 'MemoryMax(MB): -1:Infinity',
  `test_flag`  tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run',
  PRIMARY KEY (`id`),
  KEY `process_instance_id` (`process_instance_id`) USING BTREE,
  KEY `idx_code_version` (`task_code`, `task_definition_version`) USING BTREE,
  KEY `idx_cache_key` (`cache_key`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

长行

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值