You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/10/27 04:28:34 UTC
[shardingsphere] branch master updated: Update distsql doc about readwrite splitting (#21785)
This is an automated email from the ASF dual-hosted git repository.
jianglongtao 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 2d91352ab41 Update distsql doc about readwrite splitting (#21785)
2d91352ab41 is described below
commit 2d91352ab4188dc107322f9d2a13e4a9120badba
Author: jiangML <10...@qq.com>
AuthorDate: Thu Oct 27 12:28:28 2022 +0800
Update distsql doc about readwrite splitting (#21785)
* update distsql about readwrite splitting
* update doc
* update doc
---
.../distsql/syntax/ral/_index.cn.md | 12 +++++------
.../rdl/rule-definition/readwrite-splitting.cn.md | 25 +++++++++++-----------
.../rdl/rule-definition/readwrite-splitting.en.md | 13 ++++++-----
.../syntax/rdl/rule-definition/shadow.cn.md | 2 ++
.../syntax/rdl/rule-definition/shadow.en.md | 2 ++
.../distsql/usage/readwirte-splitting-rule.cn.md | 8 +++----
.../distsql/usage/readwirte-splitting-rule.en.md | 8 +++----
7 files changed, 36 insertions(+), 34 deletions(-)
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
index 8d0c7838e1b..e307c61b498 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md
@@ -35,12 +35,12 @@ RAL (Resource & Rule Administration Language) 为 Apache ShardingSphere 的管
## 熔断
-| 语句 | 说明 | 示例 |
-|:-------------------------------------------------------------------------------------------------|:------------------------------------|:--------------------------------------------------------------|
-| ALTER READWRITE_SPLITTING RULE [ groupName ] (ENABLE / DISABLE) resourceName [FROM databaseName] | 启用 / 禁用读库 | ALTER READWRITE_SPLITTING RULE group_1 ENABLE resource_0 |
-| [ENABLE / DISABLE] INSTANCE instanceId | 启用 / 禁用 proxy 实例 | DISABLE INSTANCE instance_1 |
-| SHOW INSTANCE LIST | 查询 proxy 实例信息 | SHOW INSTANCE LIST |
-| SHOW STATUS FROM READWRITE_SPLITTING (RULES / RULE groupName) [FROM databaseName] | 查询所有读库的状态 | SHOW STATUS FROM READWRITE_SPLITTING RULES |
+| 语句 | 说明 | 示例 |
+|:----------------------------------------------------------------------------------------------------|:------------------------------------|:--------------------------------------------------------------|
+| ALTER READWRITE_SPLITTING RULE [ groupName ] (ENABLE / DISABLE) storageUnitName [FROM databaseName] | 启用 / 禁用读库 | ALTER READWRITE_SPLITTING RULE group_1 ENABLE read_ds_1 |
+| [ENABLE / DISABLE] INSTANCE instanceId | 启用 / 禁用 proxy 实例 | DISABLE INSTANCE instance_1 |
+| SHOW INSTANCE LIST | 查询 proxy 实例信息 | SHOW INSTANCE LIST |
+| SHOW STATUS FROM READWRITE_SPLITTING (RULES / RULE groupName) [FROM databaseName] | 查询所有读库的状态 | SHOW STATUS FROM READWRITE_SPLITTING RULES |
## 全局规则
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/readwrite-splitting.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/readwrite-splitting.cn.md
index 6fdd955cc56..3c5ba9d89fa 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/readwrite-splitting.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/readwrite-splitting.cn.md
@@ -17,7 +17,7 @@ readwriteSplittingRuleDefinition:
[, loadBalancerDefinition])
staticReadwriteSplittingRuleDefinition:
- WRITE_RESOURCE=writeResourceName, READ_RESOURCES(readResourceName [, readResourceName] ... )
+ WRITE_STORAGE_UNIT=storageUnitName, READ_STORAGE_UNITS(storageUnitName [, storageUnitName] ... )
dynamicReadwriteSplittingRuleDefinition:
AUTO_AWARE_RESOURCE=autoAwareResourceName [, WRITE_DATA_SOURCE_QUERY_ENABLED=writeDataSourceQueryEnabled]
@@ -36,14 +36,13 @@ writeDataSourceQueryEnabled:
```
### 参数解释
-| 名称 | 数据类型 | 说明 |
-|:----------------------------|:-----------|:----------------------------|
-| ruleName | IDENTIFIER | 规则名称 |
-| writeResourceName | IDENTIFIER | 写库数据源名称 |
-| readResourceName | IDENTIFIER | 读库数据源名称 |
-| autoAwareResourceName | IDENTIFIER | 数据库发现的逻辑数据源名称 |
-| writeDataSourceQueryEnabled | BOOLEAN | 读库全部下线,主库是否承担读流量 |
-| loadBalancerType | STRING | 负载均衡算法类型 |
+| 名称 | 数据类型 | 说明 |
+|:-------------------------------|:-------------|:----------------------------|
+| ruleName | IDENTIFIER | 规则名称 |
+| storageUnitName | IDENTIFIER | 已注册的数据源名称 |
+| autoAwareResourceName | IDENTIFIER | 数据库发现的逻辑数据源名称 |
+| writeDataSourceQueryEnabled | BOOLEAN | 读库全部下线,主库是否承担读流量 |
+| loadBalancerType | STRING | 负载均衡算法类型 |
### 注意事项
@@ -57,8 +56,8 @@ writeDataSourceQueryEnabled:
```sql
// Static
CREATE READWRITE_SPLITTING RULE ms_group_0 (
-WRITE_RESOURCE=write_ds,
-READ_RESOURCES(read_ds_0,read_ds_1),
+WRITE_STORAGE_UNIT=write_ds,
+READ_STORAGE_UNITS(read_ds_0,read_ds_1),
TYPE(NAME="random")
);
@@ -70,8 +69,8 @@ TYPE(NAME="random",PROPERTIES(write_ds=2,read_ds_0=2,read_ds_1=2,read_ds_2=1))
);
ALTER READWRITE_SPLITTING RULE ms_group_1 (
-WRITE_RESOURCE=write_ds,
-READ_RESOURCES(read_ds_0,read_ds_1,read_ds_2),
+WRITE_STORAGE_UNIT=write_ds,
+READ_STORAGE_UNITS(read_ds_0,read_ds_1,read_ds_2),
TYPE(NAME="random",PROPERTIES(write_ds=2,read_ds_0=2,read_ds_1=2,read_ds_2=1))
);
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/readwrite-splitting.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/readwrite-splitting.en.md
index 38a08cd2917..f68999a2643 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/readwrite-splitting.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/readwrite-splitting.en.md
@@ -17,7 +17,7 @@ readwriteSplittingRuleDefinition:
[, loadBalancerDefinition])
staticReadwriteSplittingRuleDefinition:
- WRITE_RESOURCE=writeResourceName, READ_RESOURCES(resourceName [, resourceName] ... )
+ WRITE_STORAGE_UNIT=storageUnitName, READ_STORAGE_UNITS(storageUnitName [, storageUnitName] ... )
dynamicReadwriteSplittingRuleDefinition:
AUTO_AWARE_RESOURCE=resourceName [, WRITE_DATA_SOURCE_QUERY_ENABLED=writeDataSourceQueryEnabled]
@@ -39,8 +39,7 @@ writeDataSourceQueryEnabled:
| name | DateType | Description |
|:----------------------------|:-----------|:------------------------------------------------------------------------------------------------------------|
| ruleName | IDENTIFIER | Rule name |
-| writeResourceName | IDENTIFIER | Write data source name |
-| readResourceName | IDENTIFIER | Read data source name |
+| storageUnitName | IDENTIFIER | Registered data source name |
| autoAwareResourceName | IDENTIFIER | Database discovery logic data source name |
| writeDataSourceQueryEnabled | BOOLEAN | All read data source are offline, write data source whether the data source is responsible for read traffic |
| loadBalancerType | STRING | Load balancing algorithm type |
@@ -57,8 +56,8 @@ writeDataSourceQueryEnabled:
```sql
// Static
CREATE READWRITE_SPLITTING RULE ms_group_0 (
-WRITE_RESOURCE=write_ds,
-READ_RESOURCES(read_ds_0,read_ds_1),
+WRITE_STORAGE_UNIT=write_ds,
+READ_STORAGE_UNITS(read_ds_0,read_ds_1),
TYPE(NAME="random")
);
@@ -70,8 +69,8 @@ TYPE(NAME="random",PROPERTIES(write_ds=2,read_ds_0=2,read_ds_1=2,read_ds_2=1))
);
ALTER READWRITE_SPLITTING RULE ms_group_1 (
-WRITE_RESOURCE=write_ds,
-READ_RESOURCES(read_ds_0,read_ds_1,read_ds_2),
+WRITE_STORAGE_UNIT=write_ds,
+READ_STORAGE_UNITS(read_ds_0,read_ds_1,read_ds_2),
TYPE(NAME="random",PROPERTIES(write_ds=2,read_ds_0=2,read_ds_1=2,read_ds_2=1))
);
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/shadow.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/shadow.cn.md
index 496d8a9a91c..01260eff9af 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/shadow.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/shadow.cn.md
@@ -79,6 +79,8 @@ DROP SHADOW ALGORITHM simple_hint_algorithm;
CREATE DEFAULT SHADOW ALGORITHM TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"="true", "foo"="bar");
ALTER DEFAULT SHADOW ALGORITHM TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"="false", "foo"="bar");
+
+SHOW DEFAULT SHADOW ALGORITHM;
DROP DEFAULT SHADOW ALGORITHM;
```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/shadow.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/shadow.en.md
index 3b2168f2b5f..7d69e2fc485 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/shadow.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/shadow.en.md
@@ -80,5 +80,7 @@ CREATE DEFAULT SHADOW ALGORITHM NAME = simple_hint_algorithm;
ALTER DEFAULT SHADOW ALGORITHM TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"="false", "foo"="bar");
+SHOW DEFAULT SHADOW ALGORITHM;
+
DROP DEFAULT SHADOW ALGORITHM;
```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.cn.md
index e333217b386..024511c99bd 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.cn.md
@@ -27,8 +27,8 @@ REGISTER STORAGE UNIT write_ds (
```sql
CREATE READWRITE_SPLITTING RULE group_0 (
-WRITE_RESOURCE=write_ds,
-READ_RESOURCES(read_ds),
+WRITE_STORAGE_UNIT=write_ds,
+READ_STORAGE_UNITS(read_ds),
TYPE(NAME="random")
);
```
@@ -37,8 +37,8 @@ TYPE(NAME="random")
```sql
ALTER READWRITE_SPLITTING RULE group_0 (
-WRITE_RESOURCE=write_ds,
-READ_RESOURCES(read_ds),
+WRITE_STORAGE_UNIT=write_ds,
+READ_STORAGE_UNITS(read_ds),
TYPE(NAME="random",PROPERTIES("read_weight"="2:0"))
);
```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.en.md
index ba0332e5922..282d6c29892 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/readwirte-splitting-rule.en.md
@@ -27,8 +27,8 @@ REGISTER STORAGE UNIT write_ds (
```sql
CREATE READWRITE_SPLITTING RULE group_0 (
-WRITE_RESOURCE=write_ds,
-READ_RESOURCES(read_ds),
+WRITE_STORAGE_UNIT=write_ds,
+READ_STORAGE_UNITS(read_ds),
TYPE(NAME="random")
);
```
@@ -37,8 +37,8 @@ TYPE(NAME="random")
```sql
ALTER READWRITE_SPLITTING RULE group_0 (
-WRITE_RESOURCE=write_ds,
-READ_RESOURCES(read_ds),
+WRITE_STORAGE_UNIT=write_ds,
+READ_STORAGE_UNITS(read_ds),
TYPE(NAME="random",PROPERTIES("read_weight"="2:0"))
);
```