本文章经授权转载

Table of Contents

任务总体存储

Shell节点

SQL节点

存储过程节点

SPARK节点

MapReduce(MR)节点

Python节点

Flink节点

HTTP节点

子流程节点

依赖(DEPENDENT)节点


任务总体存储

在调度平台所创建的所有任务都保存在 t_ds_process_definition 表中。

该数据库表结构如下表所示:

序号 字段 类型 注释
1 id int 主键
2 name varchar 流程定义名称
3 version int 流程定义版本
4 release_state tinyint 流程定义的发布状态:0 未上线  1已上线
5 project_id int 项目id
6 user_id int 流程定义所属用户id
7 process_definition_json longtext 流程定义json串
8 description text 流程定义描述
9 global_params text 全局参数
10 flag tinyint 流程是否可用:0 不可用,1 可用
11 locations text 节点坐标信息
12 connects text 节点连线信息
13 receivers text 收件人
14 receivers_cc text 抄送人
15 create_time datetime 创建时间
16 timeout int 超时时间
17 tenant_id int 租户id
18 update_time datetime 更新时间

其中 process_definition_json 字段为核心字段, 定义了 DAG 图中的任务信息.该数据以 JSON 的方式进行存储。

公共的数据结构如下表:

序号 字段 类型 注释
1 globalParams Array 全局参数
2 tasks Array

流程中的任务集合[各个类型的结构请参考如下章节]

3 tenantId int 租户id
4 timeout int 超时时间

数据示例:

{
"globalParams": [
{
"prop": "golbal_bizdate",
"direct": "IN",
"type": "VARCHAR",
"value": "${system.biz.date}"
}
],
"tasks": [{}],
"tenantId": -1,
"timeout": 0
}

Shell节点

Shell节点,在worker执行的时候,会生成一个临时Shell脚本,使用租户同名的linux用户执行这个脚本。

节点定义结构如下:

序号 参数名
描述 备注
1 type
类型 值: SHELL
2 id
任务编码
3 name
名称
4 params
自定义参数 Json 格式
5
resourceList 引用资源文件
6
localParams 本地变量
7
rawScript Shell脚本
8 description
描述
9 runFlag
运行标识
10 dependence
任务依赖 与params互斥
11 maxRetryTimes
最大重试次数
12 retryInterval
重试间隔
13 timeout
超时控制
14 taskInstancePriority
任务优先级
15 workerGroupId
Worker 分组
16 preTasks
前置任务

数据示例:

{
"type": "SHELL",
"id": "tasks-17761",
"name": "shell-task",
"params": {
"resourceList": [
{
"res": "spark-examples_2.11-2.4.4.jar"
},
{
"res": "hadoop-mapreduce-examples-2.7.4.jar"
}
],
"localParams": [
{
"prop": "local_param",
"direct": "IN",
"type": "VARCHAR",
"value": "global_bizdate"
}
],
"rawScript": "echo \"thisisashelltask: ${local_param}\""
},
"description": "",
"runFlag": "NORMAL",
"dependence": {},
"maxRetryTimes": "0",
"retryInterval": "1",
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

SQL节点

通过 SQL 对指定的数据源进行数据查询、更新操作。

节点定义结构如下。

序号 参数名
描述 备注
1 type
类型 值: SQL
2 id
任务编码
3 name
名称
4 params
自定义参数 Json 格式
5
type 数据库类型
6
datasource 数据源
7
sql Sql脚本
8
udfs Udf 函数
9
sqlType SQL 类型 0 查询  1 非查询
10
title 邮件标题
11
receivers 邮件接收人
12
receiversCc 邮件抄送人
13
showType 接收类型 TABLE 表格ATTACHMENT附件
14
localParams 本地变量
15
connParams 连接参数
16
preStatements 前置 SQL
17
postStatements 后置 SQL
18 description
描述
19 runFlag
运行标识
20 dependence
任务依赖 与params互斥
21 maxRetryTimes
最大重试次数
22 retryInterval
重试间隔
23 timeout
超时控制
24 taskInstancePriority
任务优先级
25 workerGroupId
Worker 分组
26 preTasks
前置任务

数据示例:

{
"type": "SQL",
"id": "tasks-17811",
"name": "SQL节点",
"params": {
"type": "MYSQL",
"datasource": 2,
"sql": "show databases;",
"udfs": "",
"sqlType": "0",
"title": "SQL节点",
"receivers": "zhangboyi_mx@163.com",
"receiversCc": "",
"showType": "TABLE,ATTACHMENT",
"localParams": [],
"connParams": "",
"preStatements": [
"select user();"
],
"postStatements": [
"select database();"
]
},
"description": "",
"runFlag": "NORMAL",
"dependence": {},
"maxRetryTimes": "0",
"retryInterval": "1",
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

存储过程节点

根据选择的数据源,执行存储过程。

节点定义结构如下:

序号 参数名
描述 备注
1 type
类型 值: PROCEDURE
2 id
任务编码
3 name
名称
4 params
自定义参数 Json 格式
5
type 数据库类型
6
datasource 数据源 ID
7
method 方法名
8
localParams 存储过程参数
9 description
描述
10 runFlag
运行标识
11 dependence
任务依赖 与params互斥
12 maxRetryTimes
最大重试次数
13 retryInterval
重试间隔
14 timeout
超时控制
15 taskInstancePriority
任务优先级
16 workerGroupId
Worker 分组
17 preTasks
前置任务

数据示例:

{
"type": "PROCEDURE",
"id": "tasks-33589",
"name": "存储过程节点",
"params": {
"type": "MYSQL",
"datasource": 2,
"method": "add",
"localParams": [
{
"prop": "in_paramer",
"direct": "IN",
"type": "VARCHAR",
"value": ""
},
{
"prop": "out_paramer",
"direct": "OUT",
"type": "VARCHAR",
"value": ""
}
]
},
"description": "",
"runFlag": "NORMAL",
"dependence": {},
"maxRetryTimes": "0",
"retryInterval": "1",
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

SPARK节点

通过SPARK节点,可以直接直接执行SPARK程序,对于spark节点,worker会使用spark-submit方式提交任务。

节点定义结构如下:

序号 参数名
描述 备注
1 type
类型 值: SPARK
2 id
任务编码
3 name
名称
4 params
自定义参数 Json 格式
5
mainClass 运行主类
6
mainJar 程序 jar 包
7
deployMode 部署模式
8
resourceList 引用资源文件
9
localParams 本地变量
10
driverCores driver核数
11
driverMemory driver 内存数
12
numExecutors executor数量
13
executorMemory executor内存
14
executorCores executor核数
15
mainArgs 主参数
16
others 其他参数
17
programType 程序类型
18
sparkVersion Spark 版本
19 description
描述
20 runFlag
运行标识
21 dependence
任务依赖 与params互斥
22 maxRetryTimes
最大重试次数
23 retryInterval
重试间隔
24 timeout
超时控制
25 taskInstancePriority
任务优先级
26 workerGroupId
Worker 分组
27 preTasks
前置任务

数据示例:

{
"type": "SPARK",
"id": "tasks-46459",
"name": "SPARK节点",
"params": {
"mainClass": "org.apache.spark.examples.SparkPi",
"mainJar": {
"res": "spark-examples_2.11-2.4.4.jar"
},
"deployMode": "cluster",
"resourceList": [
{
"res": "spark-examples_2.11-2.4.4.jar"
}
],
"localParams": [],
"driverCores": 1,
"driverMemory": "512M",
"numExecutors": 2,
"executorMemory": "2G",
"executorCores": 2,
"mainArgs": "10",
"others": "",
"programType": "SCALA",
"sparkVersion": "SPARK2"
},
"description": "",
"runFlag": "NORMAL",
"dependence": {},
"maxRetryTimes": "0",
"retryInterval": "1",
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

MapReduce(MR)节点

使用MR节点,可以直接执行MR程序。对于mr节点,worker会使用hadoop jar方式提交任务。

节点定义结构如下:

序号 参数名
描述 备注
1 type
类型 值: MR
2 id
任务编码
3 name
名称
4 params
自定义参数 Json 格式
5
mainClass 运行主类
6
mainJar 程序 jar 包
7
resourceList 引用资源文件
8
mainArgs 主参数
9
others 其他参数
10
programType 程序类型
11 description
描述
12 runFlag
运行标识
13 dependence
任务依赖 与params互斥
14 maxRetryTimes
最大重试次数
15 retryInterval
重试间隔
16 timeout
超时控制
17 taskInstancePriority
任务优先级
18 workerGroupId
Worker 分组
19 preTasks
前置任务

数据示例:

{
"type": "MR",
"id": "tasks-70322",
"name": "MapReduce(MR)节点",
"params": {
"mainClass": "wordcount",
"mainJar": {
"res": "hadoop-mapreduce-examples-2.7.4.jar"
},
"resourceList": [
{
"res": "hadoop-mapreduce-examples-2.7.4.jar"
}
],
"localParams": [],
"mainArgs": "/wordcount/input /wordcount/output/result",
"others": "",
"programType": "JAVA"
},
"description": "",
"runFlag": "NORMAL",
"dependence": {},
"maxRetryTimes": "0",
"retryInterval": "1",
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

Python节点

使用Python节点,可以直接执行python脚本,对于python节点,worker会使用python **方式提交任务。

节点定义结构如下:

序号 参数名
描述 备注
1 type
类型 值: PYTHON
2 id
任务编码
3 name
名称
4 params
自定义参数 Json 格式
5
resourceList 引用资源文件
6
localParams 本地变量
7
rawScript Python脚本
8 description
描述
9 runFlag
运行标识
10 dependence
任务依赖 与params互斥
11 maxRetryTimes
最大重试次数
12 retryInterval
重试间隔
13 timeout
超时控制
14 taskInstancePriority
任务优先级
15 workerGroupId
Worker 分组
16 preTasks
前置任务

数据示例:

{
"type": "PYTHON",
"id": "tasks-23887",
"name": " Python节点",
"params": {
"resourceList": [
{
"res": "hadoop-mapreduce-examples-2.7.4.jar"
},
{
"res": "spark-examples_2.11-2.4.4.jar"
}
],
"localParams": [],
"rawScript": "print(\"this is python task ..\")"
},
"description": "",
"runFlag": "NORMAL",
"dependence": {},
"maxRetryTimes": "0",
"retryInterval": "1",
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

Flink节点

根据配置调用 Flink 请求。

节点定义结构如下:

序号 参数名
描述 备注
1 type
类型 值: FLINK
2 id
任务编码
3 name
名称
4 params
自定义参数 Json 格式
5
mainClass 运行主类
6
mainJar 程序 jar 包
7
deployMode 部署模式
8
resourceList 引用资源文件
9
localParams 本地变量
10
slot Slot数量
11
taskManager taskManager数量
12
taskManagerMemory taskManager内存
13
jobManagerMemory jobManager内存
14
executorCores executor核数
15
mainArgs 主参数
16
others 其他参数
17
programType 程序类型
18
sparkVersion Spark 版本
19 description
描述
20 runFlag
运行标识
21 dependence
任务依赖 与params互斥
22 maxRetryTimes
最大重试次数
23 retryInterval
重试间隔
24 timeout
超时控制
25 taskInstancePriority
任务优先级
26 workerGroupId
Worker 分组
27 preTasks
前置任务

数据示例:

{
"type": "FLINK",
"id": "tasks-84250",
"name": "Flink节点",
"params": {
"mainClass": "org.apache.spark.examples.SparkPi",
"mainJar": {
"res": "spark-examples_2.11-2.4.4.jar"
},
"deployMode": "cluster",
"resourceList": [],
"localParams": [],
"slot": 1,
"taskManager": "2",
"jobManagerMemory": "1G",
"taskManagerMemory": "2G",
"executorCores": 2,
"mainArgs": "10",
"others": "",
"programType": "SCALA"
},
"description": "",
"runFlag": "NORMAL",
"dependence": {},
"maxRetryTimes": "0",
"retryInterval": "1",
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

HTTP节点

根据配置调用 HTTP 请求。

节点定义结构如下:

序号 参数名
描述 备注
1 type
类型 值: HTTP
2 id
任务编码
3 name
名称
4 params
自定义参数 Json 格式
5
localParams 本地变量
6
httpParams 请求参数
7
url url 地址
8
httpMethod 请求方式
9
httpCheckCondition 检查条件
10
condition 检查内容
11 description
描述
12 runFlag
运行标识
13 dependence
任务依赖 与params互斥
14 maxRetryTimes
最大重试次数
15 retryInterval
重试间隔
16 timeout
超时控制
17 taskInstancePriority
任务优先级
18 workerGroupId
Worker 分组
19 preTasks
前置任务

数据示例:

{
"type": "HTTP",
"id": "tasks-31113",
"name": "http节点",
"params": {
"localParams": [],
"httpParams": [
{
"prop": "id",
"httpParametersType": "PARAMETER",
"value": "GRESFWW"
}
],
"url": "http://www.ysstech.com/",
"httpMethod": "GET",
"httpCheckCondition": "STATUS_CODE_DEFAULT",
"condition": ""
},
"description": "",
"runFlag": "NORMAL",
"dependence": {},
"maxRetryTimes": "0",
"retryInterval": "1",
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

子流程节点

子流程节点,就是把外部的某个工作流定义当做一个任务节点去执行。

节点定义结构如下:

序号 参数名
描述 备注
1 type
类型 值: SUB_PROCESS
2 id
任务编码
3 name
名称
4 params
自定义参数 Json 格式
5
processDefinitionId 流程定义 ID
6 description
描述
7 runFlag
运行标识
8 dependence
任务依赖 与params互斥
9 maxRetryTimes
最大重试次数
10 retryInterval
重试间隔
11 timeout
超时控制
12 taskInstancePriority
任务优先级
13 workerGroupId
Worker 分组
14 preTasks
前置任务
15



16



数据示例:

{
"type": "SUB_PROCESS",
"id": "tasks-22568",
"name": "子流程节点-task",
"params": {
"processDefinitionId": 2
},
"description": "",
"runFlag": "NORMAL",
"dependence": {},
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

依赖(DEPENDENT)节点

依赖节点,就是依赖检查节点。比如A流程依赖昨天的B流程执行成功,依赖节点会去检查B流程在昨天是否有执行成功的实例。

节点定义结构如下:

序号 参数名
描述 备注
1 type
类型 值: DEPENDENT
2 id
任务编码
3 name
名称
4 params
自定义参数
5 description
描述
6 runFlag
运行标识
7 dependence
任务依赖 与params互斥
8
relation 关系
9
dependTaskList 依赖任务清单
10 maxRetryTimes
最大重试次数
11 retryInterval
重试间隔
12 timeout
超时控制
13 taskInstancePriority
任务优先级
14 workerGroupId
Worker 分组
15 preTasks
前置任务

数据示例:

{
"type": "DEPENDENT",
"id": "tasks-3383",
"name": " 依赖(DEPENDENT)节点",
"params": {},
"description": "",
"runFlag": "NORMAL",
"dependence": {
"relation": "AND",
"dependTaskList": [
{
"relation": "AND",
"dependItemList": [
{
"projectId": 2,
"definitionId": 3,
"definitionList": [
{
"value": 3,
"label": "子流程节点"
},
{
"value": 2,
"label": "shell-task"
}
],
"depTasks": "ALL",
"cycle": "day",
"dateValue": "today"
}
]
}
]
},
"maxRetryTimes": "0",
"retryInterval": "1",
"timeout": {
"strategy": "",
"interval": null,
"enable": false
},
"taskInstancePriority": "MEDIUM",
"workerGroupId": -1,
"preTasks": []
}

Apache DolphinScheduler 1.2.0 task 任务存储结构说明的更多相关文章

  1. Apache DolphinScheduler 1.2.0 使用文档(1/8):架构及名词解释

    本文章经授权转载,原文链接: https://blog.csdn.net/MiaoSO/article/details/104770720 目录 1. 架构及名词解释 1.1 DolphinSched ...

  2. apache kafka系列之在zookeeper中存储结构

    1.topic注册信息 /brokers/topics/[topic] : 存储某个topic的partitions所有分配信息 Schema:   {    "version": ...

  3. 论语音社交视频直播平台与 Apache DolphinScheduler 的适配度有多高

    在 Apache DolphinScheduler& Apache ShenYu(Incubating) Meetup 上,YY 直播 软件工程师 袁丙泽 为我们分享了<YY直播基于Ap ...

  4. 金灿灿的季节 - Apache DolphinScheduler收获5位新Committer

    在这个金灿灿的收获季节,经过 Apache DolphinScheduler PPMC 们的推荐和投票,Apache DolphinScheduler 收获了 5 位新Committer .他们是:n ...

  5. Apache DolphinScheduler 迎来 2 位 PPMC

    经过 Apache DolphinScheduler PPMC 们的推荐和投票,我们高兴的宣布:Apache DolphinScheduler 迎来了 2 位 PPMC .他们是(github id) ...

  6. 感谢有你!Apache DolphinScheduler 项目 GitHub star 突破 8k

    本周伊始,Apache DolphinScheduler 项目在 GitHub 上的 Github Star 总数首次突破 8K.目前,Apache DolphinScheduler 社区已经拥有 C ...

  7. kafka笔记-Kafka在zookeeper中的存储结构【转】

    参考链接:apache kafka系列之在zookeeper中存储结构  http://blog.csdn.net/lizhitao/article/details/23744675 1.topic注 ...

  8. Apache DolphinScheduler 3.0.0 正式版发布!

    ​  点亮 ️ Star · 照亮开源之路 GitHub:https://github.com/apache/dolphinscheduler   ​ 版本发布 2022/8/10 2022 年 8 ...

  9. Apache DolphinScheduler 2.0.1 来了,备受期待的一键升级、插件化终于实现

    ✎ 编 者 按:好消息!Apache DolphinScheduler 2.0.1 版本正式发布! 本版本中,DolphinScheduler 经历了一场微内核+插件化的架构改进,70% 的代码被重构 ...

随机推荐

  1. cut-列过滤

    列过滤命令. 语法 cut [选项] 要过滤的字符串 选项 -f 以字段为单位进行分割 -c 以字符为单位进行分割 -b 以字节为单位进行分割 -d 以分割符为单位进行分割,分隔符可以是"冒 ...

  2. 配置中心Nacos(服务发现)

    服务演变之路 单体应用架构 在刚开始的时候,企业的用户量.数据量规模都⽐较⼩,项⽬所有的功能模块都放在⼀个⼯程中编码.编译.打包并且部署在⼀个Tomcat容器中的架构模式就是单体应用架构,这样的架构既 ...

  3. Python数据分析--Numpy常用函数介绍(6)--Numpy中矩阵和通用函数

    在NumPy中,矩阵是 ndarray 的子类,与数学概念中的矩阵一样,NumPy中的矩阵也是二维的,可以使用 mat . matrix 以及 bmat 函数来创建矩阵. 一.创建矩阵 mat 函数创 ...

  4. CabloyJS一站式助力微信、企业微信、钉钉开发 - 企业微信篇

    前言 现在软件开发不仅要面对前端碎片化,还要面对后端碎片化.针对前端碎片化,CabloyJS提供了pc=mobile+pad的跨端自适应方案,参见:自适应布局:pc = mobile + pad 在这 ...

  5. 回流&重绘

    浏览器加载解析页面:把HTML解析为DOM树,解析CSS生成CSSOM树,HTML DOM树和CSSOM树组合构建render树,首次触发回流和重绘后将页面结构信息发送给GPU进行绘制渲染. 回流:当 ...

  6. 开发工具-PowerShell下载地址

    更新日志 2022年6月10日 初始化链接. https://github.com/PowerShell/PowerShell/releases/

  7. TypeScript(4)接口

    介绍 TypeScript 的核心原则之一是对值所具有的结构进行类型检查.我们使用接口(Interfaces)来定义对象的类型.接口是对象的状态(属性)和行为(方法)的抽象(描述) 接口初探 声明接口 ...

  8. Flink1.13.1源码解析-Application on yarn(一)

    本篇文章讲述 Flink Application On Yarn 提交模式下,从命令提交到 AM 容器创建 1.脚本入口 flink run-application -t yarn-applicati ...

  9. python是什么?工作前景如何?怎么算有基础?爬数据违法嘛......

    随着python越来越火爆并在2021年10月,语言流行指数的编译器Tiobe将Python加冕为最受欢迎的编程语言,且置于Java.C和JavaScript之上,于是越来越多的人开始了解python ...

  10. Oracle查看所有用户及其权限

    Oracle查看所有用户及其权限:Oracle数据字典视图的种类分别为:USER,ALL 和 DBA. USER_*:有关用户所拥有的对象信息,即用户自己创建的对象信息 ALL_*:有关用户可以访问的 ...