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 3b479dd [Doc] Supplement DB_Discovery RQL document & Adjust the
display name. (#14213)
3b479dd is described below
commit 3b479dd11deeb5930678a3272cb6b6b78be1907b
Author: lanchengx <[email protected]>
AuthorDate: Wed Dec 22 13:34:37 2021 +0800
[Doc] Supplement DB_Discovery RQL document & Adjust the display name.
(#14213)
* Supplement DB_Discovery RQL document & Adjust the display name.
* Adjust the DistSQL address
* Adjust the DistSQL address
* Adjust the DistSQL address
---
.../syntax/rql/rule-query/db-discovery.cn.md | 65 +++++++++++++++++++---
.../syntax/rql/rule-query/db-discovery.en.md | 62 ++++++++++++++++++---
.../distsql/usage/db-discovery.cn.md | 28 +++++++---
.../distsql/usage/db-discovery.en.md | 28 +++++++---
.../user-manual/shardingsphere-proxy/props.cn.md | 2 +-
.../user-manual/shardingsphere-proxy/props.en.md | 2 +-
.../query/DatabaseDiscoveryRuleQueryResultSet.java | 4 +-
7 files changed, 157 insertions(+), 34 deletions(-)
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/db-discovery.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/db-discovery.cn.md
index da9d583..3fbf8e2 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/db-discovery.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/db-discovery.cn.md
@@ -7,26 +7,73 @@ weight = 4
```sql
SHOW DB_DISCOVERY RULES [FROM schemaName]
+
+SHOW DB_DISCOVERY TYPES [FROM schemaName]
+
+SHOW DB_DISCOVERY HEARTBEATS [FROM schemaName]
```
## 返回值说明
+### DB Discovery Rule
+
| 列 | 说明 |
| ------------------------ | --------------- |
| name | 规则名称 |
| data_source_names | 数据源名称列表 |
| primary_data_source_name | 主数据源名称 |
-| discover_type | 数据库发现服务类型 |
-| discover_props | 数据库发现服务参数 |
+| discovery_type | 数据库发现服务类型 |
+| discovery_heartbeat | 数据库发现服务心跳 |
+
+### DB Discovery Type
+
+| 列 | 说明 |
+| ------------------------ | ---------------|
+| name | 类型名称 |
+| type | 类型种类 |
+| props | 类型参数 |
+
+### DB Discovery Heartbeat
+
+| 列 | 说明 |
+| ------------------------ | ---------------|
+| name | 心跳名称 |
+| props | 心跳参数 |
## 示例
+*DB Discovery Rule*
+
+```sql
+mysql> show db_discovery rules;
++------------+-------------------+--------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
+| name | data_source_names | primary_data_source_name | discovery_type
| discovery_heartbeat
|
++------------+-------------------+--------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
+| ha_group_0 | ds_0,ds_1,ds_2 | ds_0 |
{name=ha_group_0_mgr, type=mgr, props={groupName=92504d5b-6dec}} |
{name=ha_group_0_heartbeat, props={keepAliveCron=0/5 * * * * ?}} |
++------------+-------------------+--------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
+1 row in set (0.20 sec)
+```
+
+*DB Discovery Type*
+
```sql
-mysql> show db_discovery rules from database_discovery_db;
-+-------+---------------------+--------------------------+---------------+------------------------------------------------------------------------------------------------------------+
-| name | data_source_names | primary_data_source_name | discover_type |
discover_props
|
-+-------+---------------------+--------------------------+---------------+------------------------------------------------------------------------------------------------------------+
-| pr_ds | ds_0, ds_1, ds_2 | ds_0 | MGR |
keepAliveCron=0/50 * * * * ?, zkServerLists=localhost:2181,
groupName=b13df29e-90b6-11e8-8d1b-525400fc3996 |
-+-------+---------------------+--------------------------+---------------+------------------------------------------------------------------------------------------------------------+
-1 row in set (0.00 sec)
+mysql> show db_discovery types;
++----------------+------+---------------------------+
+| name | type | props |
++----------------+------+---------------------------+
+| ha_group_0_mgr | mgr | {groupName=92504d5b-6dec} |
++----------------+------+---------------------------+
+1 row in set (0.01 sec)
```
+
+*DB Discovery Heartbeat*
+
+```sql
+mysql> show db_discovery heartbeats;
++----------------------+-------------------------------+
+| name | props |
++----------------------+-------------------------------+
+| ha_group_0_heartbeat | {keepAliveCron=0/5 * * * * ?} |
++----------------------+-------------------------------+
+1 row in set (0.01 sec)
+```
\ No newline at end of file
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/db-discovery.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/db-discovery.en.md
index b1072fe..2aa3d21 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/db-discovery.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/db-discovery.en.md
@@ -7,10 +7,16 @@ weight = 4
```sql
SHOW DB_DISCOVERY RULES [FROM schemaName]
+
+SHOW DB_DISCOVERY TYPES [FROM schemaName]
+
+SHOW DB_DISCOVERY HEARTBEATS [FROM schemaName]
```
## Return Value Description
+### DB Discovery Rule
+
| Column | Description |
| ------------------------ | -------------------------------------- |
| name | Rule name |
@@ -19,14 +25,56 @@ SHOW DB_DISCOVERY RULES [FROM schemaName]
| discover_type | Database discovery service type |
| discover_props | Database discovery service parameters |
+
+### DB Discovery Type
+
+| Column | Description |
+| ------------------------ | ----------------|
+| name | Type name |
+| type | Type category |
+| props | Type properties |
+
+### DB Discovery Heartbeat
+
+| Column | Description |
+| ------------------------ | ----------------------|
+| name | Heartbeat name |
+| props | Heartbeat properties |
+
## Example
+*DB Discovery Rule*
+
+```sql
+mysql> show db_discovery rules;
++------------+-------------------+--------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
+| name | data_source_names | primary_data_source_name | discovery_type
| discovery_heartbeat
|
++------------+-------------------+--------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
+| ha_group_0 | ds_0,ds_1,ds_2 | ds_0 |
{name=ha_group_0_mgr, type=mgr, props={groupName=92504d5b-6dec}} |
{name=ha_group_0_heartbeat, props={keepAliveCron=0/5 * * * * ?}} |
++------------+-------------------+--------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
+1 row in set (0.20 sec)
+```
+
+*DB Discovery Type*
+
+```sql
+mysql> show db_discovery types;
++----------------+------+---------------------------+
+| name | type | props |
++----------------+------+---------------------------+
+| ha_group_0_mgr | mgr | {groupName=92504d5b-6dec} |
++----------------+------+---------------------------+
+1 row in set (0.01 sec)
+```
+
+*DB Discovery Heartbeat*
+
```sql
-mysql> show db_discovery rules from database_discovery_db;
-+-------+---------------------+--------------------------+---------------+------------------------------------------------------------------------------------------------------------+
-| name | data_source_names | primary_data_source_name | discover_type |
discover_props
|
-+-------+---------------------+--------------------------+---------------+------------------------------------------------------------------------------------------------------------+
-| pr_ds | ds_0, ds_1, ds_2 | ds_0 | MGR |
keepAliveCron=0/50 * * * * ?, zkServerLists=localhost:2181,
groupName=b13df29e-90b6-11e8-8d1b-525400fc3996 |
-+-------+---------------------+--------------------------+---------------+------------------------------------------------------------------------------------------------------------+
-1 row in set (0.00 sec)
+mysql> show db_discovery heartbeats;
++----------------------+-------------------------------+
+| name | props |
++----------------------+-------------------------------+
+| ha_group_0_heartbeat | {keepAliveCron=0/5 * * * * ?} |
++----------------------+-------------------------------+
+1 row in set (0.01 sec)
```
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.cn.md
index 7484f08..af3ffac 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.cn.md
@@ -32,25 +32,39 @@ PASSWORD=root
- 创建数据库发现规则
```sql
-CREATE DB_DISCOVERY RULE group_0 (
-RESOURCES(ds_0,ds_1),
-TYPE(NAME=mgr,PROPERTIES(groupName='92504d5b-6dec',keepAliveCron=''))
+CREATE DB_DISCOVERY RULE ha_group_0 (
+RESOURCES(ds_0, ds_1),
+TYPE(NAME=mgr,PROPERTIES('groupName'='92504d5b-6dec')),
+HEARTBEAT(PROPERTIES('keepAliveCron'='0/5 * * * * ?'))
);
```
- 修改数据库发现规则
```sql
-ALTER DB_DISCOVERY RULE group_0 (
-RESOURCES(ds_0,ds_1,ds_2),
-TYPE(NAME=mgr,PROPERTIES(groupName='92504d5b-6dec' ,keepAliveCron=''))
+ALTER DB_DISCOVERY RULE ha_group_0 (
+RESOURCES(ds_0, ds_1, ds_2),
+TYPE(NAME=mgr,PROPERTIES('groupName'='92504d5b-6dec')),
+HEARTBEAT(PROPERTIES('keepAliveCron'='0/5 * * * * ?'))
);
```
- 删除数据库发现规则
```sql
-DROP DB_DISCOVERY RULE group_0;
+DROP DB_DISCOVERY RULE ha_group_0;
+```
+
+- 删除数据库发现类型
+
+```sql
+DROP DB_DISCOVERY TYPE ha_group_0_mgr;
+```
+
+- 删除数据库发现心跳
+
+```sql
+DROP DB_DISCOVERY HEARTBEAT ha_group_0_heartbeat;
```
- 删除数据源
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.en.md
index 0f687e5..2b415a7 100644
---
a/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.en.md
+++
b/docs/document/content/user-manual/shardingsphere-proxy/distsql/usage/db-discovery.en.md
@@ -32,25 +32,39 @@ PASSWORD=root
- Create DB discovery rule
```sql
-CREATE DB_DISCOVERY RULE group_0 (
-RESOURCES(ds_0,ds_1),
-TYPE(NAME=mgr,PROPERTIES(groupName='92504d5b-6dec',keepAliveCron=''))
+CREATE DB_DISCOVERY RULE ha_group_0 (
+RESOURCES(ds_0, ds_1),
+TYPE(NAME=mgr,PROPERTIES('groupName'='92504d5b-6dec')),
+HEARTBEAT(PROPERTIES('keepAliveCron'='0/5 * * * * ?'))
);
```
- Alter DB discovery rule
```sql
-ALTER DB_DISCOVERY RULE group_0 (
-RESOURCES(ds_0,ds_1,ds_2),
-TYPE(NAME=mgr,PROPERTIES(groupName='92504d5b-6dec' ,keepAliveCron=''))
+ALTER DB_DISCOVERY RULE ha_group_0 (
+RESOURCES(ds_0, ds_1, ds_2),
+TYPE(NAME=mgr,PROPERTIES('groupName'='92504d5b-6dec')),
+HEARTBEAT(PROPERTIES('keepAliveCron'='0/5 * * * * ?'))
);
```
- Drop db_discovery rule
```sql
-DROP DB_DISCOVERY RULE group_0;
+DROP DB_DISCOVERY RULE ha_group_0;
+```
+
+- Drop db_discovery type
+
+```sql
+DROP DB_DISCOVERY TYPE ha_group_0_mgr;
+```
+
+- Drop db_discovery heartbeat
+
+```sql
+DROP DB_DISCOVERY HEARTBEAT ha_group_0_heartbeat;
```
- Drop resource
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/props.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/props.cn.md
index 0fc538c..b42f1f2 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/props.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/props.cn.md
@@ -28,5 +28,5 @@ Apache ShardingSphere 提供属性配置的方式配置系统级配置。
| proxy-frontend-max-connections (?) | int | 允许连接 Proxy 的最大客户端数量,默认值 0
代表不限制。
| 0 | 是 |
| sql-federation-enabled (?) | boolean | 是否开启 federation 查询。
| false | 是
|
-属性配置可以通过 [DistSQL](/cn/user-manual/shardingsphere-proxy/distsql/usage/) 修改。
+属性配置可以通过 [DistSQL](/cn/user-manual/shardingsphere-proxy/distsql/) 修改。
支持动态修改的属性可以立即生效,不支持动态修改的属性需要重启后生效。
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/props.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/props.en.md
index d357268..3166884 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/props.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/props.en.md
@@ -28,5 +28,5 @@ Apache ShardingSphere provides the way of property
configuration to configure sy
| proxy-frontend-max-connections (?) | int | The maximum permitted
number of client connections to Proxy. The default value is 0 and less than or
equal to 0 means no limitation.
| 0 | true |
| sql-federation-enabled (?) | boolean | Whether enable sql
federation.
| false | true |
-Properties can be updated by
[DistSQL](/cn/user-manual/shardingsphere-proxy/distsql/usage/).
+Properties can be updated by
[DistSQL](/en/user-manual/shardingsphere-proxy/distsql/).
Dynamic update can take effect immediately, static update can take effect
after restarted.
diff --git
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/main/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/query/DatabaseDiscoveryRuleQueryResultSet.java
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/main/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/query/DatabaseDiscoveryRuleQuer
[...]
index 3fca535..3c4c74d 100644
---
a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/main/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/query/DatabaseDiscoveryRuleQueryResultSet.java
+++
b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-distsql/shardingsphere-db-discovery-distsql-handler/src/main/java/org/apache/shardingsphere/dbdiscovery/distsql/handler/query/DatabaseDiscoveryRuleQueryResultSet.java
@@ -48,9 +48,9 @@ public final class DatabaseDiscoveryRuleQueryResultSet
implements DistSQLResultS
private static final String PRIMARY_DATA_SOURCE_NAME =
"primary_data_source_name";
- private static final String DISCOVER_TYPE = "discover_type";
+ private static final String DISCOVER_TYPE = "discovery_type";
- private static final String HEARTBEAT = "heartbeat";
+ private static final String HEARTBEAT = "discovery_heartbeat";
private Iterator<DatabaseDiscoveryDataSourceRuleConfiguration> data;