You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2021/10/27 04:06:23 UTC

[shardingsphere] branch master updated: Add column value match shadow algorithm docs. (#13301)

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 a59f385  Add column value match shadow algorithm docs. (#13301)
a59f385 is described below

commit a59f38554766f4c168e5b599af31d69626bebccb
Author: gin <ja...@163.com>
AuthorDate: Wed Oct 27 12:05:44 2021 +0800

    Add column value match shadow algorithm docs. (#13301)
---
 docs/document/content/dev-manual/shadow.cn.md            | 15 ++++++++-------
 docs/document/content/dev-manual/shadow.en.md            | 15 ++++++++-------
 docs/document/content/reference/shadow/_index.cn.md      | 16 ++++++++--------
 .../configuration/built-in-algorithm/shadow.cn.md        | 14 +++++++++++++-
 .../configuration/built-in-algorithm/shadow.en.md        | 14 +++++++++++++-
 5 files changed, 50 insertions(+), 24 deletions(-)

diff --git a/docs/document/content/dev-manual/shadow.cn.md b/docs/document/content/dev-manual/shadow.cn.md
index a9048d4..7a29acb 100644
--- a/docs/document/content/dev-manual/shadow.cn.md
+++ b/docs/document/content/dev-manual/shadow.cn.md
@@ -7,11 +7,12 @@ chapter = true
 
 ## ShadowAlgorithm
 
-| *SPI 名称*                                | *详细说明*                       |
-| ----------------------------------------- | -------------------------------- |
-| ShadowAlgorithm                           | shadow库路由算法                 |
+| *SPI 名称* | *详细说明* |
+|-----------|-----------|
+| ShadowAlgorithm | 影子库路由算法 |
 
-| *已知实现类*                              | *详细说明*                       |
-| ----------------------------------------- | -------------------------------- |
-| ColumnRegexMatchShadowAlgorithm           | 基于字段值正则匹配shadow路由算法|
-| SimpleSQLNoteShadowAlgorithm              | 基于SQL注解简单匹配shadow路由算法|
+| *已知实现类* | *详细说明* |
+|------------|----------|
+| ColumnValueMatchShadowAlgorithm | 基于字段值匹配影子算法 |
+| ColumnRegexMatchShadowAlgorithm | 基于字段值正则匹配影子算法 |
+| SimpleSQLNoteShadowAlgorithm | 基于SQL注解简单匹配影子算法 |
diff --git a/docs/document/content/dev-manual/shadow.en.md b/docs/document/content/dev-manual/shadow.en.md
index 801e2bb..d5ad12b 100644
--- a/docs/document/content/dev-manual/shadow.en.md
+++ b/docs/document/content/dev-manual/shadow.en.md
@@ -7,11 +7,12 @@ chapter = true
 
 ## ShadowAlgorithm
 
-| *SPI Name*                                | *Description*                       |
-| ----------------------------------------- | ----------------------------------- |
-| ShadowAlgorithm                           | shadow routing algorithm            |
+| *SPI Name* | *Description* |
+|-----------|-----------|
+| ShadowAlgorithm | shadow routing algorithm |
 
-| *Implementation Class*                    | *Description*                       |
-| ----------------------------------------- | ----------------------------------- |
-| ColumnRegexMatchShadowAlgorithm           | Column regex match shadow algorithm |
-| SimpleSQLNoteShadowAlgorithm              | Simple SQL note shadow algorithm    |
+| *Implementation Class* | *Description* |
+|------------|----------|
+| ColumnValueMatchShadowAlgorithm | Column value match shadow algorithm |
+| ColumnRegexMatchShadowAlgorithm | Column regex match shadow algorithm |
+| SimpleSQLNoteShadowAlgorithm | Simple SQL note shadow algorithm |
diff --git a/docs/document/content/reference/shadow/_index.cn.md b/docs/document/content/reference/shadow/_index.cn.md
index 2308a7e..9ef7b20 100644
--- a/docs/document/content/reference/shadow/_index.cn.md
+++ b/docs/document/content/reference/shadow/_index.cn.md
@@ -80,11 +80,11 @@ shadow-algorithms:
       shadow: true
       foo: bar
   user-id-match-algorithm:
-    type: COLUMN_REGEX_MATCH
+    type: COLUMN_VALUE_MATCH
     props:
       operation: insert
       column: user_id
-      regex: "[0]"
+      value: 0
       
 props:
   sql-comment-parse-enabled: true
@@ -124,11 +124,11 @@ INSERT INTO t_order (order_id, user_id, ...) VALUES (xxx..., 0, ...)
 ```yaml
 shadow-algorithms:
   user-id-match-algorithm:
-    type: COLUMN_REGEX_MATCH
+    type: COLUMN_VALUE_MATCH
     props:
       operation: insert
       column: user_id
-      regex: "[0]"
+      value: 0
 ```
 
 **注意**:影子表使用列影子算法时,相同类型操作(INSERT, UPDATE, DELETE, SELECT)目前仅支持单个字段。
@@ -168,11 +168,11 @@ SELECT * FROM t_order WHERE order_id = xxx /*shadow:true,foo:bar,...*/;
 ```yaml
 shadow-algorithms:
   user-id-match-algorithm:
-    type: COLUMN_REGEX_MATCH
+    type: COLUMN_VALUE_MATCH
     props:
       operation: insert
       column: user_id
-      regex: "[0]"
+      value: 0
   simple-note-algorithm:
     type: SIMPLE_NOTE
     props:
@@ -217,11 +217,11 @@ shadow-algorithms:
       shadow: true
       foo: bar
   user-id-match-algorithm:
-    type: COLUMN_REGEX_MATCH
+    type: COLUMN_VALUE_MATCH
     props:
       operation: insert
       column: user_id
-      regex: "[0]"
+      value: 0
       
 props:
   sql-comment-parse-enabled: true
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/shadow.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/shadow.cn.md
index cbf333d..250b118 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/shadow.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/shadow.cn.md
@@ -5,6 +5,18 @@ weight = 5
 
 ## 列影子算法
 
+### 列值匹配影子算法
+
+类型:COLUMN_VALUE_MATCH
+
+可配置属性:
+
+| *属性名称*      | *数据类型* | *说明*  |
+| -------------- | --------- | ------- |
+| column         | String    | 影子列 |
+| operation      | String    | SQL 操作类型(INSERT, UPDATE, DELETE, SELECT) |
+| value          | String    | 影子列匹配的值 |
+
 ### 列正则表达式匹配影子算法
 
 类型:COLUMN_REGEX_MATCH
@@ -15,7 +27,7 @@ weight = 5
 | -------------- | --------- | ------- |
 | column         | String    | 匹配列 |
 | operation      | String    | SQL操作类型(INSERT, UPDATE, DELETE, SELECT) |
-| regex          | String    | 匹配正则表达式 |
+| regex          | String    | 影子列匹配正则表达式 |
 
 ## 注解影子算法
 
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/shadow.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/shadow.en.md
index da39995..d9364a9 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/shadow.en.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/built-in-algorithm/shadow.en.md
@@ -5,6 +5,18 @@ weight = 5
 
 ## Column Shadow Algorithm
 
+### Column Value Match Shadow Algorithm
+
+Type:COLUMN_VALUE_MATCH
+
+Attributes:
+
+| *Name*      | *DataType* | *Description*  |
+| -------------- | --------- | ------- |
+| column         | String    | Shadow column |
+| operation      | String    | SQL operation type(INSERT, UPDATE, DELETE, SELECT) |
+| value          | String    | Shadow column matching value |
+
 ### Column Regex Match Shadow Algorithm
 
 Type: COLUMN_REGEX_MATCH
@@ -15,7 +27,7 @@ Attributes:
 | -------------- | --------- | ------- |
 | column         | String    | Shadow column |
 | operation      | String    | SQL operation type (insert, update, delete, select) |
-| regex          | String    | Regular expression |
+| regex          | String    | Shadow column matching regular expression |
 
 ## Note Shadow Algorithm