You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/07/19 09:58:04 UTC
[shardingsphere-elasticjob] branch master updated: Update
dev-manual document (#1168)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob.git
The following commit(s) were added to refs/heads/master by this push:
new 9d2df35 Update dev-manual document (#1168)
9d2df35 is described below
commit 9d2df35ae60fbda911fb596f6ca711be15c4fe0a
Author: Liang Zhang <te...@163.com>
AuthorDate: Sun Jul 19 17:57:54 2020 +0800
Update dev-manual document (#1168)
* Move lite-design to elastic
* Update dev-manual
* Update sharding
* Update dev-manual
* Update job-class-provider
---
docs/content/dev-manual/_index.cn.md | 10 +++-
docs/content/dev-manual/_index.en.md | 10 +++-
docs/content/dev-manual/customized-hook.cn.md | 16 -----
docs/content/dev-manual/customized-hook.en.md | 8 ---
docs/content/dev-manual/error-handler.cn.md | 17 ++++++
docs/content/dev-manual/error-handler.en.md | 17 ++++++
docs/content/dev-manual/job-class-provider.cn.md | 16 +++++
docs/content/dev-manual/job-class-provider.en.md | 16 +++++
.../content/dev-manual/job-sharding-strategy.cn.md | 69 ----------------------
.../content/dev-manual/job-sharding-strategy.en.md | 8 ---
docs/content/dev-manual/roadmap.cn.md | 6 +-
docs/content/dev-manual/roadmap.en.md | 6 +-
docs/content/dev-manual/sharding.cn.md | 18 ++++++
docs/content/dev-manual/sharding.en.md | 18 ++++++
docs/content/dev-manual/thread-pool.cn.md | 16 +++++
docs/content/dev-manual/thread-pool.en.md | 15 +++++
16 files changed, 154 insertions(+), 112 deletions(-)
diff --git a/docs/content/dev-manual/_index.cn.md b/docs/content/dev-manual/_index.cn.md
index dd658b2..7594e19 100644
--- a/docs/content/dev-manual/_index.cn.md
+++ b/docs/content/dev-manual/_index.cn.md
@@ -5,7 +5,11 @@ weight = 5
chapter = true
+++
-# 本章导航
+ElasticJob 可插拔架构提供了 SPI 的扩展点。
+对于开发者来说,可以十分方便的对功能进行定制化扩展。
+
+本章节将 ElasticJob 的 SPI 扩展点悉数列出。
+如无特殊需求,用户可以使用 ElasticJob 提供的内置实现;
+高级用户则可以参考各个功能模块的接口进行自定义实现。
- - 想了解架构设计及项目模块设计的概念,请阅读[实现原理](/cn/dev-manual/lite-design/)。
- - ElasticJob 未来规划有哪些呢?请阅读[未来规划](/cn/dev-manual/roadmap/)。
+ElasticJob 社区非常欢迎开发者将自己的实现类反馈至[开源社区](https://github.com/apache/shardingsphere-elasticjob/pulls),让更多用户从中收益。
diff --git a/docs/content/dev-manual/_index.en.md b/docs/content/dev-manual/_index.en.md
index 36f5dff..6882609 100644
--- a/docs/content/dev-manual/_index.en.md
+++ b/docs/content/dev-manual/_index.en.md
@@ -5,6 +5,12 @@ weight = 5
chapter = true
+++
-# 本章导航
+ElasticJob provides dozens of SPI based extensions.
+it is very convenient to customize the functions for developers.
- TODO
+This chapter lists all SPI extensions of ElasticJob.
+If there is no special requirement, users can use the built-in implementation provided by ElasticJob;
+advanced users can refer to the interfaces for customized implementation.
+
+ElasticJob community welcomes developers to feed back their implementations to the [open-source community](https://github.com/apache/shardingsphere-elasticjob/pulls),
+so that more users can benefit from it.
diff --git a/docs/content/dev-manual/customized-hook.cn.md b/docs/content/dev-manual/customized-hook.cn.md
deleted file mode 100644
index e377653..0000000
--- a/docs/content/dev-manual/customized-hook.cn.md
+++ /dev/null
@@ -1,16 +0,0 @@
-+++
-pre = "<b>5.3. </b>"
-title = "定制化处理"
-weight = 3
-chapter = true
-+++
-
-ElasticJob 在配置中提供了 JobHandler,用于定制化处理,目前支持自定义异常处理及作业处理线程池。
-
-## 异常处理
-
-可扩展 JobErrorHandler 接口,默认实现是记录日志但不抛出异常。
-
-## 作业处理线程池
-
-可扩展 JobExecutorServiceHandler 接口,定制线程池。
diff --git a/docs/content/dev-manual/customized-hook.en.md b/docs/content/dev-manual/customized-hook.en.md
deleted file mode 100644
index 2713415..0000000
--- a/docs/content/dev-manual/customized-hook.en.md
+++ /dev/null
@@ -1,8 +0,0 @@
-+++
-pre = "<b>5.3. </b>"
-title = "Customization"
-weight = 3
-chapter = true
-+++
-
-TODO
diff --git a/docs/content/dev-manual/error-handler.cn.md b/docs/content/dev-manual/error-handler.cn.md
new file mode 100644
index 0000000..28ed9a4
--- /dev/null
+++ b/docs/content/dev-manual/error-handler.cn.md
@@ -0,0 +1,17 @@
++++
+pre = "<b>5.3. </b>"
+title = "错误处理策略"
+weight = 3
++++
+
+错误处理策略,用于作业失败时的处理策略。
+
+| *SPI 名称* | *详细说明* |
+| --------------------- | ------------------------------ |
+| JobErrorHandler | 作业执行线程池策略 |
+
+| *已知实现类* | *详细说明* |
+| --------------------- | ------------------------------ |
+| LogJobErrorHandler | 记录作业异常日志,但不中断作业执行 |
+| ThrowJobErrorHandler | 抛出系统异常并中断作业执行 |
+| IgnoreJobErrorHandler | 忽略系统异常且不中断作业执行 |
diff --git a/docs/content/dev-manual/error-handler.en.md b/docs/content/dev-manual/error-handler.en.md
new file mode 100644
index 0000000..4731138
--- /dev/null
+++ b/docs/content/dev-manual/error-handler.en.md
@@ -0,0 +1,17 @@
++++
+pre = "<b>5.3. </b>"
+title = "Error Handler"
+weight = 3
++++
+
+Error handler strategy, used to handle error when exception occur during job execution.
+
+| *SPI Name* | *Description* |
+| ---------------------- | ----------------------------------------- |
+| JobErrorHandler | Job executor service handler |
+
+| *Implementation Class* | *Description* |
+| ---------------------- | ----------------------------------------- |
+| LogJobErrorHandler | Log error and do not interrupt job |
+| ThrowJobErrorHandler | Throw system exception and interrupt job |
+| IgnoreJobErrorHandler | Ignore exception and do not interrupt job |
diff --git a/docs/content/dev-manual/job-class-provider.cn.md b/docs/content/dev-manual/job-class-provider.cn.md
new file mode 100644
index 0000000..27bff49
--- /dev/null
+++ b/docs/content/dev-manual/job-class-provider.cn.md
@@ -0,0 +1,16 @@
++++
+pre = "<b>5.4. </b>"
+title = "作业类名称提供策略"
+weight = 4
++++
+
+作业类名称提供策略,用于在不同的容器环境下提供准确的作业类名称。
+
+| *SPI 名称* | *详细说明* |
+| ------------------------------- | --------------------------------- |
+| JobClassNameProvider | 作业类名称提供策略 |
+
+| *已知实现类* | *详细说明* |
+| ------------------------------- | --------------------------------- |
+| SimpleJobClassNameProvider | 标准环境下的作业类名称提供策略 |
+| SpringProxyJobClassNameProvider | Spring 容器环境下的作业类名称提供策略 |
diff --git a/docs/content/dev-manual/job-class-provider.en.md b/docs/content/dev-manual/job-class-provider.en.md
new file mode 100644
index 0000000..3630ee6
--- /dev/null
+++ b/docs/content/dev-manual/job-class-provider.en.md
@@ -0,0 +1,16 @@
++++
+pre = "<b>5.4. </b>"
+title = "Job Class Name Provider"
+weight = 4
++++
+
+Job class name provider, used to provide job class name in different contain environments.
+
+| *SPI Name* | *Description* |
+| ------------------------------- | ------------------------------------------------------- |
+| JobClassNameProvider | Job class name provider |
+
+| *Implementation Class* | *Description* |
+| ------------------------------- | ------------------------------------------------------- |
+| SimpleJobClassNameProvider | Job class name provider in standard environment |
+| SpringProxyJobClassNameProvider | Job class name provider in Spring container environment |
diff --git a/docs/content/dev-manual/job-sharding-strategy.cn.md b/docs/content/dev-manual/job-sharding-strategy.cn.md
deleted file mode 100644
index 28559ca..0000000
--- a/docs/content/dev-manual/job-sharding-strategy.cn.md
+++ /dev/null
@@ -1,69 +0,0 @@
-+++
-pre = "<b>5.2. </b>"
-title = "作业分片策略"
-weight = 2
-chapter = true
-+++
-
-## 框架提供的分片策略
-
-### AverageAllocationJobShardingStrategy
-
-**全路径:**
-
-AverageAllocationJobShardingStrategy
-
-**策略说明:**
-
-基于平均分配算法的分片策略,也是默认的分片策略。
-
-如果分片不能整除,则不能整除的多余分片将依次追加到序号小的服务器。如:
-
-如果有3台服务器,分成9片,则每台服务器分到的分片是:1=[0,1,2], 2=[3,4,5], 3=[6,7,8]
-
-如果有3台服务器,分成8片,则每台服务器分到的分片是:1=[0,1,6], 2=[2,3,7], 3=[4,5]
-
-如果有3台服务器,分成10片,则每台服务器分到的分片是:1=[0,1,2,9], 2=[3,4,5], 3=[6,7,8]
-
-### OdevitySortByNameJobShardingStrategy
-
-
-**全路径:**
-
-OdevitySortByNameJobShardingStrategy
-
-**策略说明:**
-
-根据作业名的哈希值奇偶数决定IP升降序算法的分片策略。
-
-作业名的哈希值为奇数则IP升序。
-
-作业名的哈希值为偶数则IP降序。
-
-用于不同的作业平均分配负载至不同的服务器。
-
-AverageAllocationJobShardingStrategy的缺点是,一旦分片数小于作业服务器数,作业将永远分配至IP地址靠前的服务器,导致IP地址靠后的服务器空闲。而OdevitySortByNameJobShardingStrategy则可以根据作业名称重新分配服务器负载。如:
-
-如果有3台服务器,分成2片,作业名称的哈希值为奇数,则每台服务器分到的分片是:1=[0], 2=[1], 3=[]
-
-如果有3台服务器,分成2片,作业名称的哈希值为偶数,则每台服务器分到的分片是:3=[0], 2=[1], 1=[]
-
-### RotateServerByNameJobShardingStrategy
-
-**全路径:**
-
-org.apache.shardingsphere.elasticjob.lite.handler.sharding.impl.RotateServerByNameJobShardingStrategy
-
-**策略说明:**
-
-根据作业名的哈希值对服务器列表进行轮转的分片策略。
-
-## 自定义分片策略
-
-实现JobShardingStrategy接口并实现sharding方法,接口方法参数为作业服务器IP列表和分片策略选项,分片策略选项包括作业名称,分片总数以及分片序列号和个性化参数对照表,可以根据需求定制化自己的分片策略。
-
-欢迎将分片策略以插件的形式贡献至org.apache.shardingsphere.elasticjob.lite.handler.sharding包。
-
-## 配置分片策略
-
-与配置通常的作业属性相同,在spring命名空间或者JobConfiguration中配置jobShardingStrategyType属性,属性值是作业分片策略类的全路径。
diff --git a/docs/content/dev-manual/job-sharding-strategy.en.md b/docs/content/dev-manual/job-sharding-strategy.en.md
deleted file mode 100644
index 626608b..0000000
--- a/docs/content/dev-manual/job-sharding-strategy.en.md
+++ /dev/null
@@ -1,8 +0,0 @@
-+++
-pre = "<b>5.2. </b>"
-title = "Job Sharding Strategy"
-weight = 2
-chapter = true
-+++
-
-TODO
diff --git a/docs/content/dev-manual/roadmap.cn.md b/docs/content/dev-manual/roadmap.cn.md
index 4614941..d370781 100644
--- a/docs/content/dev-manual/roadmap.cn.md
+++ b/docs/content/dev-manual/roadmap.cn.md
@@ -1,11 +1,11 @@
+++
-pre = "<b>5.4. </b>"
+pre = "<b>5.5. </b>"
title = "线路规划"
-weight = 4
+weight = 5
chapter = true
+++
-## Core
+## Kernel
- [x] Unified Job Config API
- [x] Core Config
diff --git a/docs/content/dev-manual/roadmap.en.md b/docs/content/dev-manual/roadmap.en.md
index bcc6304..6437f65 100644
--- a/docs/content/dev-manual/roadmap.en.md
+++ b/docs/content/dev-manual/roadmap.en.md
@@ -1,11 +1,11 @@
+++
-pre = "<b>5.4. </b>"
+pre = "<b>5.5. </b>"
title = "Roadmap"
-weight = 4
+weight = 5
chapter = true
+++
-## Core
+## Kernel
- [x] Unified Job Config API
- [x] Core Config
diff --git a/docs/content/dev-manual/sharding.cn.md b/docs/content/dev-manual/sharding.cn.md
new file mode 100644
index 0000000..e4a2333
--- /dev/null
+++ b/docs/content/dev-manual/sharding.cn.md
@@ -0,0 +1,18 @@
++++
+pre = "<b>5.1. </b>"
+title = "作业分片策略"
+weight = 1
+chapter = true
++++
+
+作业分片策略,用于将作业在分布式环境下分解成为任务使用。
+
+| *SPI 名称* | *详细说明* |
+| ------------------------------------- | ------------------------------------------------------------- |
+| JobShardingStrategy | 作业分片策略 |
+
+| *已知实现类* | *详细说明* |
+| ------------------------------------- | -------------------------------------------------------------- |
+| AverageAllocationJobShardingStrategy | 根据分片项平均分片 |
+| OdevitySortByNameJobShardingStrategy | 根据作业名称哈希值的奇偶数决定按照作业服务器 IP 升序或是降序的方式分片 |
+| RotateServerByNameJobShardingStrategy | 根据作业名称轮询分片 |
diff --git a/docs/content/dev-manual/sharding.en.md b/docs/content/dev-manual/sharding.en.md
new file mode 100644
index 0000000..16219b0
--- /dev/null
+++ b/docs/content/dev-manual/sharding.en.md
@@ -0,0 +1,18 @@
++++
+pre = "<b>5.1. </b>"
+title = "Job Sharding Strategy"
+weight = 1
+chapter = true
++++
+
+Job Sharding Strategy, used to sharding job to distributed tasks.
+
+| *SPI Name* | *Description* |
+| ------------------------------------- | ----------------------------------------------------------- |
+| JobShardingStrategy | Job sharding strategy |
+
+| *Implementation Class* | *Description* |
+| ------------------------------------- | ----------------------------------------------------------- |
+| AverageAllocationJobShardingStrategy | Sharding or average by sharding item |
+| OdevitySortByNameJobShardingStrategy | Sharding for hash with job name to determine IP asc or desc |
+| RotateServerByNameJobShardingStrategy | Sharding for round robin by name job |
diff --git a/docs/content/dev-manual/thread-pool.cn.md b/docs/content/dev-manual/thread-pool.cn.md
new file mode 100644
index 0000000..136a978
--- /dev/null
+++ b/docs/content/dev-manual/thread-pool.cn.md
@@ -0,0 +1,16 @@
++++
+pre = "<b>5.2. </b>"
+title = "线程池策略"
+weight = 2
++++
+
+线程池策略,用于执行作业的线程池创建。
+
+| *SPI 名称* | *详细说明* |
+| ------------------------------------- | --------------------------------- |
+| JobExecutorServiceHandler | 作业执行线程池策略 |
+
+| *已知实现类* | *详细说明* |
+| ------------------------------------- | --------------------------------- |
+| CPUUsageJobExecutorServiceHandler | 根据 CPU 核数 * 2 创建作业处理线程池 |
+| SingleThreadJobExecutorServiceHandler | 使用单线程处理作业 |
diff --git a/docs/content/dev-manual/thread-pool.en.md b/docs/content/dev-manual/thread-pool.en.md
new file mode 100644
index 0000000..0c43b0e
--- /dev/null
+++ b/docs/content/dev-manual/thread-pool.en.md
@@ -0,0 +1,15 @@
++++
+title = "Thread Pool Strategy"
+weight = 2
++++
+
+Thread pool strategy, used to create thread pool for job execution.
+
+| *SPI Name* | *Description* |
+| ------------------------------------- | ------------------------------------------------------ |
+| JobExecutorServiceHandler | Job executor service handler |
+
+| *Implementation Class* | *Description* |
+| ------------------------------------- | ------------------------------------------------------ |
+| CPUUsageJobExecutorServiceHandler | Use CPU available processors * 2 to create thread pool |
+| SingleThreadJobExecutorServiceHandler | Use single thread to execute job |