This is an automated email from the ASF dual-hosted git repository.

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 932263fa478 Update the key generator algorithm configuration changes 
in the docs (#20483)
932263fa478 is described below

commit 932263fa478900712f884fe99ff78b5920f82a19
Author: gin <[email protected]>
AuthorDate: Wed Aug 24 15:10:27 2022 +0800

    Update the key generator algorithm configuration changes in the docs 
(#20483)
---
 .../common-config/builtin-algorithm/keygen.cn.md           | 14 +++++++++-----
 .../common-config/builtin-algorithm/keygen.en.md           |  5 +++++
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git 
a/docs/document/content/user-manual/common-config/builtin-algorithm/keygen.cn.md
 
b/docs/document/content/user-manual/common-config/builtin-algorithm/keygen.cn.md
index 4199824b922..4d65aa86e5a 100644
--- 
a/docs/document/content/user-manual/common-config/builtin-algorithm/keygen.cn.md
+++ 
b/docs/document/content/user-manual/common-config/builtin-algorithm/keygen.cn.md
@@ -17,10 +17,15 @@ weight = 3
 
 可配置属性:
 
-| *属性名称*                                     | *数据类型* | *说明*                   
                                                                                
                                                                            | 
*默认值* |
-| --------------------------------------------- | -------- | 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 | ------- |
-| max-vibration-offset (?)                      | int      | 最大抖动上限值,范围[0, 
4096)。注:若使用此算法生成值作分片值,建议配置此属性。此算法在不同毫秒内所生成的 key 取模 2^n (2^n一般为分库或分表数) 之后结果总为 0 
或 1。为防止上述分片问题,建议将此属性值配置为 (2^n)-1 | 1      |
-| max-tolerate-time-difference-milliseconds (?) | long     | 最大容忍时钟回退时间,单位:毫秒  
                                                                                
                                                                        | 10 毫秒 
|
+| *属性名称*                                      | *数据类型* | *说明*                  
                                                                                
                                                                           | 
*默认值* |
+| --------------------------------------------- | -------- | 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 | ------- |
+| worker-id (?)                                 | long     | 工作机器唯一标识          
                                                                                
                                                                            | 0 
      |
+| max-vibration-offset (?)                      | int      | 最大抖动上限值,范围[0, 
4096)。注:若使用此算法生成值作分片值,建议配置此属性。此算法在不同毫秒内所生成的 key 取模 2^n (2^n一般为分库或分表数) 之后结果总为 0 
或 1。为防止上述分片问题,建议将此属性值配置为 (2^n)-1  | 1       |
+| max-tolerate-time-difference-milliseconds (?) | long     | 最大容忍时钟回退时间,单位:毫秒  
                                                                                
                                                                       | 10 毫秒  
|
+
+*注意*:worker-id 为选配项
+1. 在单机模式下支持用户自定义配置,如果用户不配置使用默认值为0。
+2. 在集群模式下会由系统自动生成,相同的命名空间下不会生成重复的值。
 
 ### NanoID
 
@@ -63,7 +68,6 @@ weight = 3
 ## 配置示例
 
 - 雪花算法
-
 ```yaml
 keyGenerators:
   snowflake:
diff --git 
a/docs/document/content/user-manual/common-config/builtin-algorithm/keygen.en.md
 
b/docs/document/content/user-manual/common-config/builtin-algorithm/keygen.en.md
index 78ec11c1751..5c00335dffc 100644
--- 
a/docs/document/content/user-manual/common-config/builtin-algorithm/keygen.en.md
+++ 
b/docs/document/content/user-manual/common-config/builtin-algorithm/keygen.en.md
@@ -24,9 +24,14 @@ Attributes:
 
 | *Name*                                        | *DataType* | *Description*   
                                                             | *Default Value* |
 | --------------------------------------------- | ---------- | 
---------------------------------------------------------------------------- | 
--------------- |
+| worker-id (?)                                 | long       | The unique ID 
for working machine                                            | 0              
 |
 | max-tolerate-time-difference-milliseconds (?) | long       | The max 
tolerate time for different server's time difference in milliseconds | 10 
milliseconds |
 | max-vibration-offset (?)                      | int        | The max upper 
limit value of vibrate number, range `[0, 4096)`. Notice: To use the generated 
value of this algorithm as sharding value, it is recommended to configure this 
property. The algorithm generates key mod `2^n` (`2^n` is usually the sharding 
amount of tables or databases) in different milliseconds and the result is 
always `0` or `1`. To prevent the above sharding problem, it is recommended to 
configure this property, [...]
 
+*Note*: worker-id is optional
+1. In standalone mode, support user-defined configuration, if the user does 
not configure the default value of 0.
+2. In cluster mode, it will be automatically generated by the system, and 
duplicate values will not be generated in the same namespace.
+
 ### Nano ID
 
 Type:NANOID

Reply via email to