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 2020/06/15 12:03:26 UTC
[shardingsphere] branch master updated: Update user-manual of
java-config (#6050)
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 40d46aa Update user-manual of java-config (#6050)
40d46aa is described below
commit 40d46aad6824a4586425de2c91a4536d94f168da
Author: Liang Zhang <te...@163.com>
AuthorDate: Mon Jun 15 20:03:09 2020 +0800
Update user-manual of java-config (#6050)
* Update user-manual of java-config/read-write-split
* Update user-manual of java-config/sharding
* Update user-manual of java-config
* Update user-manual of java-config/sharding
* Update user-manual of java-config/sharding
* Update user-manual of java-config/sharding
* Update user-manual of java-config/sharding
* Update user-manual of java-config/sharding
---
docs/community/content/team/_index.en.md | 3 +-
.../configuration/java-api/_index.cn.md | 2 +-
.../configuration/java-api/encrypt.cn.md | 10 +-
.../configuration/java-api/encrypt.en.md | 10 +-
.../configuration/java-api/read-write-split.cn.md | 26 +++--
.../configuration/java-api/read-write-split.en.md | 18 ++--
.../configuration/java-api/sharding.cn.md | 83 +++++++++------
.../configuration/java-api/sharding.en.md | 113 +++++++++++----------
.../rule/ShardingAutoTableRuleConfiguration.java | 1 -
...a => KeyGenerateStrategyConfigurationTest.java} | 2 +-
.../sharding/DatetimeShardingAlgorithm.java | 4 +-
11 files changed, 151 insertions(+), 121 deletions(-)
diff --git a/docs/community/content/team/_index.en.md b/docs/community/content/team/_index.en.md
index 58f26d0..93e0a5a 100644
--- a/docs/community/content/team/_index.en.md
+++ b/docs/community/content/team/_index.en.md
@@ -54,4 +54,5 @@ You can find all contributors of ShardingSphere from GitHub contribution list.
The ShardingSphere community follows the [Apache Community’s process](http://community.apache.org/newcommitter.html) on accepting a new committer.
After a contributor participate ShardingSphere community actively, (P)PMC and Committers will make decision to invite the contributor join Committers and (P)PMC.
-You can read [Contributor Guide](/en/contribute/contributor/) to participate the community, and can get more information on [Committer Guide](/en/contribute/committer/).
\ No newline at end of file
+You can read [Contributor Guide](/en/contribute/contributor/) to participate the community, and can get more information on [Committer Guide](/en/contribute/committer/).
+
\ No newline at end of file
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/_index.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/_index.cn.md
index 9db918e..b7b10ad 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/_index.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/_index.cn.md
@@ -6,7 +6,7 @@ chapter = true
## 简介
-Java API 是 ShardingSphere-JDBC 中所有配置方式的基础,其他配置最终都将转化成为Java API 的配置方式。
+Java API 是 ShardingSphere-JDBC 中所有配置方式的基础,其他配置最终都将转化成为 Java API 的配置方式。
Java API 是最复杂也是最灵活的配置方式,适合需要通过编程进行动态配置的场景下使用。
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/encrypt.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/encrypt.cn.md
index f14ef95..e3db360 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/encrypt.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/encrypt.cn.md
@@ -9,10 +9,10 @@ weight = 3
可配置属性:
-| *名称* | *数据类型* | *说明* |
-| -------------- | -------------------------------------------- | ------------------ |
-| tables (+) | Collection\<EncryptTableRuleConfiguration\> | 加密表规则配置 |
-| encryptors (+) | Map\<String, EncryptAlgorithmConfiguration\> | 加解密算法名称和配置 |
+| *名称* | *数据类型* | *说明* |
+| -------------- | --------------------------------------------------- | ------------------ |
+| tables (+) | Collection\<EncryptTableRuleConfiguration\> | 加密表规则配置 |
+| encryptors (+) | Map\<String, ShardingSphereAlgorithmConfiguration\> | 加解密算法名称和配置 |
## 加密表规则配置
@@ -41,7 +41,7 @@ weight = 3
## 加解密算法配置
-类名称:org.apache.shardingsphere.encrypt.api.config.strategy.EncryptAlgorithmConfiguration
+类名称:org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration
可配置属性:
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/encrypt.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/encrypt.en.md
index ea65786..057d840 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/encrypt.en.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/encrypt.en.md
@@ -9,10 +9,10 @@ Class name: org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguratio
Attributes:
-| *Name* | *DataType* | *Description* |
-| -------------- | -------------------------------------------- | ------------------------------------------ |
-| tables (+) | Collection\<EncryptTableRuleConfiguration\> | Encrypt table rule configurations |
-| encryptors (+) | Map\<String, EncryptAlgorithmConfiguration\> | Encrypt algorithm name and configurations |
+| *Name* | *DataType* | *Description* |
+| -------------- | --------------------------------------------------- | ----------------------------------------- |
+| tables (+) | Collection\<EncryptTableRuleConfiguration\> | Encrypt table rule configurations |
+| encryptors (+) | Map\<String, ShardingSphereAlgorithmConfiguration\> | Encrypt algorithm name and configurations |
## Encrypt Table Rule Configuration
@@ -41,7 +41,7 @@ Attributes:
## Encrypt Algorithm Configuration
-Class name: org.apache.shardingsphere.encrypt.api.config.strategy.EncryptAlgorithmConfiguration
+Class name: org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration
Attributes:
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/read-write-split.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/read-write-split.cn.md
index 7a93edb..03329c0 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/read-write-split.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/read-write-split.cn.md
@@ -12,7 +12,7 @@ weight = 2
| *名称* | *数据类型* | *说明* |
| ----------------- | ---------------------------------------------------- | ----------------- |
| dataSources (+) | Collection\<MasterSlaveDataSourceRuleConfiguration\> | 主从数据源配置 |
-| loadBalancers (*) | Map\<String, LoadBalanceAlgorithmConfiguration\> | 从库负载均衡算法配置 |
+| loadBalancers (*) | Map\<String, ShardingSphereAlgorithmConfiguration\> | 从库负载均衡算法配置 |
## 主从数据源配置
@@ -20,19 +20,23 @@ weight = 2
可配置属性:
-| *名称* | *数据类型* | *说明* | *默认值* |
-| -------------------- | -------------------- | ------------------ | ------------- |
-| name | String | 读写分离数据源名称 | - |
-| masterDataSourceName | String | 主库数据源名称 | - |
-| slaveDataSourceNames | Collection\<String\> | 从库数据源名称列表 | - |
-| loadBalancerName (?) | String | 从库负载均衡算法名称 | 轮询负载均衡算法 |
+| *名称* | *数据类型* | *说明* | *默认值* |
+| ------------------------ | -------------------- | ------------------ | ------------- |
+| name | String | 读写分离数据源名称 | - |
+| masterDataSourceName | String | 主库数据源名称 | - |
+| slaveDataSourceNames (+) | Collection\<String\> | 从库数据源名称列表 | - |
+| loadBalancerName (?) | String | 从库负载均衡算法名称 | 轮询负载均衡算法 |
## 从库负载均衡算法配置
-| *名称* | *数据类型* | *说明* | *默认值* |
-| -------------- | ---------- | -------------------- | -------------- |
-| type | String | 从库负载均衡算法类型 | - |
-| properties (?) | Properties | 从库负载均衡算法属性配置 | 空 |
+类名称:org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration
+
+可配置属性:
+
+| *名称* | *数据类型* | *说明* | *默认值* |
+| -------------- | ---------- | -------------------- | ------- |
+| type | String | 从库负载均衡算法类型 | - |
+| properties (?) | Properties | 从库负载均衡算法属性配置 | 空 |
Apache ShardingSphere 内置的从库负载均衡算法实现类包括:
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/read-write-split.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/read-write-split.en.md
index e247a54..faa2e7c 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/read-write-split.en.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/read-write-split.en.md
@@ -12,7 +12,7 @@ Attributes:
| *Name* | *DataType* | *Description* |
| ----------------- | ---------------------------------------------------- | -------------------------------------------------------------------- |
| dataSources (+) | Collection\<MasterSlaveDataSourceRuleConfiguration\> | Data sources of master and slaves |
-| loadBalancers (*) | Map\<String, LoadBalanceAlgorithmConfiguration\> | Load balance algorithm name and configurations of slave data sources |
+| loadBalancers (*) | Map\<String, ShardingSphereAlgorithmConfiguration\> | Load balance algorithm name and configurations of slave data sources |
## Master Slave Data Source Configuration
@@ -20,15 +20,19 @@ Class name: org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDat
Attributes:
-| *Name* | *DataType* | *Description* | *Default Value* |
-| -------------------- | -------------------- | -------------------------------------------- | ---------------------------------- |
-| name | String | Read-write split data source name | - |
-| masterDataSourceName | String | Master sources source name | - |
-| slaveDataSourceNames | Collection\<String\> | Slave sources source name list | - |
-| loadBalancerName (?) | String | Load balance algorithm name of slave sources | Round robin load balance algorithm |
+| *Name* | *DataType* | *Description* | *Default Value* |
+| ------------------------ | -------------------- | -------------------------------------------- | ---------------------------------- |
+| name | String | Read-write split data source name | - |
+| masterDataSourceName | String | Master sources source name | - |
+| slaveDataSourceNames (+) | Collection\<String\> | Slave sources source name list | - |
+| loadBalancerName (?) | String | Load balance algorithm name of slave sources | Round robin load balance algorithm |
## Slave Data Sources Load Balance Algorithm Configuration
+Class name: org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration
+
+Attributes:
+
| *Name* | *DataType* | *Description* | *Default Value* |
| -------------- | ---------- | ---------------------------------------------------- | --------------- |
| type | String | Slave data sources load balance algorithm type | - |
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/sharding.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/sharding.cn.md
index 9ebe8dc..0bf6c4a 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/sharding.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/sharding.cn.md
@@ -9,16 +9,19 @@ weight = 1
可配置属性:
-| *名称* | *数据类型* | *说明* | *默认值* |
-| ----------------------------------- | -------------------------------------------- | ----------------- | ------- |
-| tables (+) | Collection\<ShardingTableRuleConfiguration\> | 分片表规则列表 | - |
-| bindingTableGroups (*) | Collection\<String\> | 绑定表规则列表 | 无 |
-| broadcastTables (*) | Collection\<String\> | 广播表规则列表 | 无 |
-| defaultDatabaseShardingStrategy (?) | ShardingStrategyConfiguration | 默认分库策略 | 不分片 |
-| defaultTableShardingStrategy (?) | ShardingStrategyConfiguration | 默认分表策略 | 不分片 |
-| defaultKeyGenerateStrategy (?) | KeyGeneratorConfiguration | 默认自增列生成器配置 | 雪花算法 |
-
-## 逻辑表配置
+| *名称* | *数据类型* | *说明* | *默认值* |
+| ----------------------------------- | --------------------------------------------------- | -------------------- | ------- |
+| tables (+) | Collection\<ShardingTableRuleConfiguration\> | 分片表规则列表 | - |
+| autoTables (+) | Collection\<ShardingAutoTableRuleConfiguration\> | 自动化分片表规则列表 | - |
+| bindingTableGroups (*) | Collection\<String\> | 绑定表规则列表 | 无 |
+| broadcastTables (*) | Collection\<String\> | 广播表规则列表 | 无 |
+| defaultDatabaseShardingStrategy (?) | ShardingStrategyConfiguration | 默认分库策略 | 不分片 |
+| defaultTableShardingStrategy (?) | ShardingStrategyConfiguration | 默认分表策略 | 不分片 |
+| defaultKeyGenerateStrategy (?) | KeyGeneratorConfiguration | 默认自增列生成器配置 | 雪花算法 |
+| shardingAlgorithms (+) | Map\<String, ShardingSphereAlgorithmConfiguration\> | 分片算法名称和配置 | 无 |
+| keyGenerators (?) | Map\<String, ShardingSphereAlgorithmConfiguration\> | 自增列生成算法名称和配置 | 无 |
+
+## 分片表配置
类名称:org.apache.shardingsphere.sharding.api.config.ShardingTableRuleConfiguration
@@ -26,11 +29,24 @@ weight = 1
| *名称* | *数据类型* | *说明* | *默认值* |
| ---------------------------- | ----------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
-| logicTable | String | 逻辑表名称 | - |
+| logicTable | String | 分片逻辑表名称 | - |
| actualDataNodes (?) | String | 由数据源名 + 表名组成,以小数点分隔。<br />多个表以逗号分隔,支持行表达式 | 使用已知数据源与逻辑表名称生成数据节点,用于广播表或只分库不分表且所有库的表结构完全一致的情况 |
| databaseShardingStrategy (?) | ShardingStrategyConfiguration | 分库策略 | 使用默认分库策略 |
| tableShardingStrategy (?) | ShardingStrategyConfiguration | 分表策略 | 使用默认分表策略 |
-| keyGenerateStrategy (?) | KeyGeneratorConfiguration | 自增列生成器 | 使用默认自增主键生成器 |
+| keyGenerateStrategy (?) | KeyGeneratorConfiguration | 自增列生成器 | 使用默认自增主键生成器 |
+
+## 自动分片表配置
+
+类名称:org.apache.shardingsphere.sharding.api.config.ShardingAutoTableRuleConfiguration
+
+可配置属性:
+
+| *名称* | *数据类型* | *说明* | *默认值* |
+| ----------------------- | ----------------------------- | ---------------------------- | ------------------ |
+| logicTable | String | 分片逻辑表名称 | - |
+| actualDataSources (?) | String | 数据源名称,多个数据源以逗号分隔 | 使用全部配置的数据源 |
+| shardingStrategy (?) | ShardingStrategyConfiguration | 分片策略 | 使用默认分片策略 |
+| keyGenerateStrategy (?) | KeyGeneratorConfiguration | 自增列生成器 | 使用默认自增主键生成器 |
## 分片策略配置
@@ -40,10 +56,10 @@ weight = 1
可配置属性:
-| *名称* | *数据类型* | *说明* |
-| ----------------- | ------------------------- | ---------------- |
-| shardingColumn | String | 分片列名称 |
-| shardingAlgorithm | StandardShardingAlgorithm | 标准分片算法实现类 |
+| *名称* | *数据类型* | *说明* |
+| --------------------- | ---------- | ---------- |
+| shardingColumn | String | 分片列名称 |
+| shardingAlgorithmName | String | 分片算法名称 |
Apache ShardingSphere 内置的标准分片算法实现类包括:
@@ -86,8 +102,8 @@ Apache ShardingSphere 内置的标准分片算法实现类包括:
| *属性名称* | *数据类型* | *说明* |
| ---------------- | --------- | -------------------------- |
-| partition.lower | long | 范围下界,超过边界的数据会报错 |
-| partition.upper | long | 范围上界,超过边界的数据会报错 |
+| range.lower | long | 范围下界,超过边界的数据会报错 |
+| range.upper | long | 范围上界,超过边界的数据会报错 |
| partition.volume | long | 分片容量 |
#### 自定义边界范围分片算法
@@ -108,7 +124,8 @@ Apache ShardingSphere 内置的标准分片算法实现类包括:
| *属性名称* | *数据类型* | *说明* |
| ----------------- | --------- | ----------------------------------------------- |
-| epoch | String | 分片时间的起始纪元,时间戳格式:yyyy-MM-dd HH:mm:ss |
+| datetime.lower | String | 分片的起始时间范围,时间戳格式:yyyy-MM-dd HH:mm:ss |
+| datetime.upper | String | 分片的结束时间范围,时间戳格式:yyyy-MM-dd HH:mm:ss |
| partition.seconds | long | 单一分片所能承载的最大时间,单位:秒 |
#### 自定义时间边界分片算法
@@ -132,41 +149,41 @@ Apache ShardingSphere 内置的标准分片算法实现类包括:
可配置属性:
-| *名称* | *数据类型* | *说明* |
-| ----------------- | ---------------------------- | ------------------------ |
-| shardingColumns | String | 分片列名称,多个列以逗号分隔 |
-| shardingAlgorithm | ComplexKeysShardingAlgorithm | 复合分片算法实现类 |
+| *名称* | *数据类型* | *说明* |
+| --------------------- | ---------- | ------------------------ |
+| shardingColumns | String | 分片列名称,多个列以逗号分隔 |
+| shardingAlgorithmName | String | 分片算法名称 |
Apache ShardingSphere 暂无内置复合分片算法实现类。
### Hint 分片策略配置
-类名称:HintShardingStrategyConfiguration
+类名称:org.apache.shardingsphere.sharding.api.config.strategy.sharding.HintShardingStrategyConfiguration
可配置属性:
-| *名称* | *数据类型* | *说明* |
-| ----------------- | --------------------- | ----------- |
-| shardingAlgorithm | HintShardingAlgorithm | Hint分片算法 |
+| *名称* | *数据类型* | *说明* |
+| --------------------- | ---------- | ----------- |
+| shardingAlgorithmName | String | 分片算法名称 |
Apache ShardingSphere 暂无内置复合分片算法实现类。
### 不分片策略配置
-类名称:NoneShardingStrategyConfiguration
+类名称:org.apache.shardingsphere.sharding.api.config.strategy.sharding.NoneShardingStrategyConfiguration
可配置属性:无
## 自增主键策略配置
-类名称:KeyGeneratorConfiguration
+类名称:org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration
可配置属性:
-| *名称* | *数据类型* | *说明* |
-| --------- | -------------------- | ---------------- |
-| column | String | 自增列名称 |
-| algorithm | KeyGenerateAlgorithm | 自增主键算法实现类 |
+| *名称* | *数据类型* | *说明* |
+| ---------------- | -------- | -------------- |
+| column | String | 自增列名称 |
+| keyGeneratorName | String | 自增主键算法名称 |
Apache ShardingSphere 内置的自增主键算法实现类包括:
diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/sharding.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/sharding.en.md
index b66f30b..2b1dbff 100644
--- a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/sharding.en.md
+++ b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/java-api/sharding.en.md
@@ -9,14 +9,17 @@ Class name: org.apache.shardingsphere.sharding.api.config.ShardingRuleConfigurat
Attributes:
-| *Name* | *DataType* | *Description* | *Default Value* |
-| ----------------------------------- | -------------------------------------------- | ---------------------------------- | --------------- |
-| tables (+) | Collection\<ShardingTableRuleConfiguration\> | Sharding table rules | - |
-| bindingTableGroups (*) | Collection\<String\> | Binding table rules | Empty |
-| broadcastTables (*) | Collection\<String\> | Broadcast table rules | Empty |
-| defaultDatabaseShardingStrategy (?) | ShardingStrategyConfiguration | Default database sharding strategy | Not sharding |
-| defaultTableShardingStrategy (?) | ShardingStrategyConfiguration | Default table sharding strategy | Not sharding |
-| defaultKeyGenerateStrategy (?) | KeyGeneratorConfiguration | Default key generator | Snowflake |
+| *Name* | *DataType* | *Description* | *Default Value* |
+| ----------------------------------- | --------------------------------------------------- | ---------------------------------------------- | --------------- |
+| tables (+) | Collection\<ShardingTableRuleConfiguration\> | Sharding table rules | - |
+| autoTables (+) | Collection\<ShardingAutoTableRuleConfiguration\> | Sharding automatic table rules | - |
+| bindingTableGroups (*) | Collection\<String\> | Binding table rules | Empty |
+| broadcastTables (*) | Collection\<String\> | Broadcast table rules | Empty |
+| defaultDatabaseShardingStrategy (?) | ShardingStrategyConfiguration | Default database sharding strategy | Not sharding |
+| defaultTableShardingStrategy (?) | ShardingStrategyConfiguration | Default table sharding strategy | Not sharding |
+| defaultKeyGenerateStrategy (?) | KeyGeneratorConfiguration | Default key generator | Snowflake |
+| shardingAlgorithms (+) | Map\<String, ShardingSphereAlgorithmConfiguration\> | Sharding algorithm name and configurations | None |
+| keyGenerators (?) | Map\<String, ShardingSphereAlgorithmConfiguration\> | Key generate algorithm name and configurations | None |
## Sharding Table Configuration
@@ -24,13 +27,26 @@ Class name: org.apache.shardingsphere.sharding.api.config.ShardingTableRuleConfi
Attributes:
-| *Name* | *DataType* | *Description* | *Default Value* |
-| ---------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
-| logicTable | String | Name of logic table | - |
-| actualDataNodes (?) | String | Describe data source names and actual tables, delimiter as point.<br /> Multiple data nodes split by comma, support inline expression | Broadcast table or databases sharding only. |
-| databaseShardingStrategy (?) | ShardingStrategyConfiguration | Databases sharding strategy | Use default databases sharding strategy |
-| tableShardingStrategy (?) | ShardingStrategyConfiguration | Tables sharding strategy | Use default tables sharding strategy |
-| keyGenerateStrategy (?) | KeyGeneratorConfiguration | Key generator configuration | Use default key generator |
+| *Name* | *DataType* | *Description* | *Default Value* |
+| ---------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
+| logicTable | String | Name of sharding logic table | - |
+| actualDataNodes (?) | String | Describe data source names and actual tables, delimiter as point.<br /> Multiple data nodes split by comma, support inline expression | Broadcast table or databases sharding only |
+| databaseShardingStrategy (?) | ShardingStrategyConfiguration | Databases sharding strategy | Use default databases sharding strategy |
+| tableShardingStrategy (?) | ShardingStrategyConfiguration | Tables sharding strategy | Use default tables sharding strategy |
+| keyGenerateStrategy (?) | KeyGeneratorConfiguration | Key generator configuration | Use default key generator |
+
+## Sharding Automatic Table Configuration
+
+Class name: org.apache.shardingsphere.sharding.api.config.ShardingAutoTableRuleConfiguration
+
+Attributes:
+
+| *Name* | *DataType* | *Description* | *Default Value* |
+| ----------------------- | ----------------------------- | ----------------------------------------------------------- | ------------------------------- |
+| logicTable | String | Name of sharding logic table | - |
+| actualDataSources (?) | String | Data source names.<br /> Multiple data nodes split by comma | Use all configured data sources |
+| shardingStrategy (?) | ShardingStrategyConfiguration | Sharding strategy | Use default sharding strategy |
+| keyGenerateStrategy (?) | KeyGeneratorConfiguration | Key generator configuration | Use default key generator |
## Sharding Strategy Configuration
@@ -40,10 +56,10 @@ Class name: org.apache.shardingsphere.sharding.api.config.strategy.StandardShard
Attributes:
-| *Name* | *DataType* | *Description* |
-| -------------------------- | ------------------------- | ----------------------------------------------- |
-| shardingColumn | String | Sharding column name |
-| shardingAlgorithm | StandardShardingAlgorithm | Standard sharding algorithm class |
+| *Name* | *DataType* | *Description* |
+| --------------------- | ---------- | ----------------------- |
+| shardingColumn | String | Sharding column name |
+| shardingAlgorithmName | String | Sharding algorithm name |
Apache ShardingSphere built-in implemented classes of StandardShardingAlgorithm are:
@@ -86,8 +102,8 @@ Attributes:
| *Name* | *DataType* | *Description* |
| ---------------- | ---------- | -------------------------------------------------------- |
-| partition.lower | long | Range lower bound, throw exception if lower than bound |
-| partition.upper | long | Range upper bound, throw exception if upper than bound |
+| range.lower | long | Range lower bound, throw exception if lower than bound |
+| range.upper | long | Range upper bound, throw exception if upper than bound |
| partition.volume | long | Sharding volume |
#### Customized Range Sharding Algorithm
@@ -100,27 +116,15 @@ Attributes:
| ---------------- | ---------- | ----------------------------------------------------------------- |
| partition.ranges | String | Range of sharding border, multiple boundaries separated by commas |
-#### Fixed Range Volume Sharding Algorithm
-
-Class name: org.apache.shardingsphere.sharding.strategy.algorithm.sharding.range.StandardRangeShardingAlgorithm
-
-Attributes:
-
-| *Name* | *DataType* | *Description* |
-| ---------------- | ---------- | ------------------------------------------------------------------- |
-| partition.lower | long | Lower bound of range, data beyond the boundary will report an error |
-| partition.upper | long | Upper bound of range, data beyond the boundary will report an error |
-| partition.volume | long | Range volume |
-
#### Custom Range Bound Sharding Algorithm
Class name: org.apache.shardingsphere.sharding.strategy.algorithm.sharding.range.CustomRangeShardingAlgorithm
Attributes:
-| *Name* | *DataType* | *Description* |
-| ---------------- | ---------- | --------------------------------- |
-| partition.ranges | String | 分片的范围边界,多个范围边界以逗号分隔 |
+| *Name* | *DataType* | *Description* |
+| ---------------- | ---------- | ------------------------------------------------------------------ |
+| partition.ranges | String | Sharding range boundaries, multiple boundaries separated by commas |
#### Fixed Time Range Sharding Algorithm
@@ -128,10 +132,11 @@ Class name: org.apache.shardingsphere.sharding.strategy.algorithm.sharding.Datet
Attributes:
-| *Name* | *DataType* | *Description* |
-| ----------------- | ---------- | -------------------------------------------------- |
-| epoch | String | Shard datetime epoch, pattern: yyyy-MM-dd HH:mm:ss |
-| partition.seconds | long | Max seconds for the data in one shard |
+| *Name* | *DataType* | *Description* |
+| ----------------- | ---------- | ----------------------------------------------------------- |
+| datetime.lower | String | Shard datetime begin boundary, pattern: yyyy-MM-dd HH:mm:ss |
+| datetime.upper | String | Shard datetime end boundary, pattern: yyyy-MM-dd HH:mm:ss |
+| partition.seconds | long | Max seconds for the data in one shard |
#### Custom Datetime Bound Sharding Algorithm
@@ -150,14 +155,14 @@ Attributes:
### Complex Sharding Strategy Configuration
-Class name: ComplexShardingStrategyConfiguration
+Class name: 类名称:org.apache.shardingsphere.sharding.api.config.strategy.sharding.HintShardingStrategyConfiguration
Attributes:
-| *Name* | *DataType* | *Description* |
-| ----------------- | ---------------------------- | ----------------------------------------- |
-| shardingColumns | String | Sharding column name, separated by commas |
-| shardingAlgorithm | ComplexKeysShardingAlgorithm | Complex sharding algorithm |
+| *Name* | *DataType* | *Description* |
+| --------------------- | ---------- | ----------------------------------------- |
+| shardingColumns | String | Sharding column name, separated by commas |
+| shardingAlgorithmName | String | Sharding algorithm name |
There is no built-in complex keys sharding algorithm implementation class in Apache ShardingSphere.
@@ -167,28 +172,28 @@ Class name: HintShardingStrategyConfiguration
Attributes:
-| *Name* | *DataType* | *Description* |
-| ----------------- | --------------------- | ----------------------- |
-| shardingAlgorithm | HintShardingAlgorithm | Hint sharding algorithm |
+| *Name* | *DataType* | *Description* |
+| --------------------- | ---------- | ----------------------- |
+| shardingAlgorithmName | String | Sharding algorithm name |
There is no built-in hint sharding algorithm implementation class in Apache ShardingSphere.
### None Sharding Strategy Configuration
-Class name: NoneShardingStrategyConfiguration
+Class name: org.apache.shardingsphere.sharding.api.config.strategy.sharding.NoneShardingStrategyConfiguration
Attributes: None
## Key Generator Configuration
-Class name: KeyGeneratorConfiguration
+Class name: org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration
Attributes:
-| *Name* | *DataType* | *Description* |
-| --------- | -------------------- | ---------------------------- |
-| column | String | Column name of key generate |
-| algorithm | KeyGenerateAlgorithm | Key generate algorithm class |
+| *Name* | *DataType* | *Description* |
+| ---------------- | ---------- | ---------------------------- |
+| column | String | Column name of key generate |
+| keyGeneratorName | String | key generate algorithm name |
Apache ShardingSphere built-in implemented classes of KeyGenerateAlgorithm are:
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/rule/ShardingAutoTableRuleConfiguration.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/rule/ShardingAutoTableRuleConfiguration.java
index 43f79ef..ecb8f72 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/rule/ShardingAutoTableRuleConfiguration.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/rule/ShardingAutoTableRuleConfiguration.java
@@ -26,7 +26,6 @@ import org.apache.shardingsphere.sharding.api.config.strategy.sharding.ShardingS
/**
* Sharding auto table rule configuration.
- *
*/
@Getter
@Setter
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/test/java/org/apache/shardingsphere/sharding/api/config/rule/KeyGeneratorConfigurationTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/test/java/org/apache/shardingsphere/sharding/api/config/rule/KeyGenerateStrategyConfigurationTest.java
similarity index 95%
rename from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/test/java/org/apache/shardingsphere/sharding/api/config/rule/KeyGeneratorConfigurationTest.java
rename to shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/test/java/org/apache/shardingsphere/sharding/api/config/rule/KeyGenerateStrategyConfigurationTest.java
index d538803..dfb5bdc 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/test/java/org/apache/shardingsphere/sharding/api/config/rule/KeyGeneratorConfigurationTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/test/java/org/apache/shardingsphere/sharding/api/config/rule/KeyGenerateStrategyConfigurationTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sharding.api.config.rule;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.junit.Test;
-public final class KeyGeneratorConfigurationTest {
+public final class KeyGenerateStrategyConfigurationTest {
@Test
public void assertConstructorWithoutKeyGenerator() {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/strategy/algorithm/sharding/DatetimeShardingAlgorithm.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/strategy/algorithm/sharding/DatetimeShardingAlgorithm.java
index 7304817..5d06986 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/strategy/algorithm/sharding/DatetimeShardingAlgorithm.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/strategy/algorithm/sharding/DatetimeShardingAlgorithm.java
@@ -46,12 +46,12 @@ import java.util.Properties;
@Getter
public final class DatetimeShardingAlgorithm implements StandardShardingAlgorithm<Comparable<?>>, ShardingAutoTableAlgorithm {
- private static final String PARTITION_SECONDS = "partition.seconds";
-
private static final String DATETIME_LOWER = "datetime.lower";
private static final String DATETIME_UPPER = "datetime.upper";
+ private static final String PARTITION_SECONDS = "partition.seconds";
+
private static final String DATETIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DATETIME_PATTERN);