未验证 提交 cc4020d4 编写于 作者: J Juan Pan(Trista) 提交者: GitHub

Merge pull request #7229 from 291277058/#7163

fix #7163 replace dot with hyphen in configuration keys
......@@ -239,8 +239,8 @@ ShardingSphere中很多功能实现类的加载方式是通过[SPI](https://shar
回答:
1. 需要使用4.1.0以上版本。
2. 将配置项`allow.range.query.with.inline.sharding`设置为true即可(默认为false)。
1. 需要使用5.x以上版本。
2. 将配置项`allow-range-query-with-inline-sharding`设置为true即可(默认为false)。
3. 需要注意的是,此时所有的范围查询将会使用广播的方式查询每一个分表。
## 20. 为什么配置了某个数据连接池的spring-boot-starter(比如druid)和shardingsphere-jdbc-spring-boot-starter时,系统启动会报错?
......
......@@ -236,8 +236,8 @@ Answer:
Answer:
1. Update to 4.0.1 above.
2. Configure`allow.range.query.with.inline.sharding` to `true` (Default value is `false`).
1. Update to 5.x above.
2. Configure`allow-range-query-with-inline-sharding` to `true` (Default value is `false`).
3. A tip here: then each range query will be broadcast to every sharding table.
## 20. Why there may be an error when configure both shardingsphere-jdbc-spring-boot-starter and a spring-boot-starter of certain datasource pool(such as druid)?
......@@ -265,4 +265,4 @@ Answer:
Answer:
1. `shardingsphere-transaction-xa-core` include atomikos, it will trigger auto-configuration mechanism in spring-boot, add `@SpringBootApplication(exclude = JtaAutoConfiguration.class)` will solve it.
\ No newline at end of file
1. `shardingsphere-transaction-xa-core` include atomikos, it will trigger auto-configuration mechanism in spring-boot, add `@SpringBootApplication(exclude = JtaAutoConfiguration.class)` will solve it.
......@@ -77,7 +77,7 @@ Apache ShardingSphere 接收到该 SQL,通过用户提供的加密配置,发
aes_encryptor:
type: AES
props:
aes.key.value: 123456abc
aes-key-value: 123456abc
tables:
t_user:
columns:
......@@ -117,7 +117,7 @@ Apache ShardingSphere 接收到该 SQL,通过用户提供的加密配置,发
aes_encryptor:
type: AES
props:
aes.key.value: 123456abc
aes-key-value: 123456abc
tables:
t_user:
columns:
......@@ -172,7 +172,7 @@ props:
aes_encryptor:
type: AES
props:
aes.key.value: 123456abc
aes-key-value: 123456abc
tables:
t_user:
columns:
......
......@@ -99,7 +99,7 @@ It can also be different **. The recommended configuration is as follows (shown
aes_encryptor:
type: AES
props:
aes.key.value: 123456abc
aes-key-value: 123456abc
tables:
t_user:
columns:
......@@ -155,7 +155,7 @@ In addition, demonstrate a set of encryption configuration rules, as follows:
aes_encryptor:
type: AES
props:
aes.key.value: 123456abc
aes-key-value: 123456abc
tables:
t_user:
columns:
......@@ -222,7 +222,7 @@ So the encryption configuration after migration is:
aes_encryptor:
type: AES
props:
aes.key.value: 123456abc
aes-key-value: 123456abc
tables:
t_user:
columns:
......
......@@ -253,7 +253,7 @@ encryptRule:
aes_encryptor:
type: AES
props:
aes.key.value: 123456abc
aes-key-value: 123456abc
md5_encryptor:
type: MD5
tables:
......
......@@ -254,7 +254,7 @@ encryptRule:
aes_encryptor:
type: AES
props:
aes.key.value: 123456abc
aes-key-value: 123456abc
md5_encryptor:
type: MD5
tables:
......
......@@ -17,7 +17,7 @@ weight = 4
| *名称* | *数据类型* | *说明* |
| ------------- | --------- | ------------- |
| aes.key.value | String | AES 使用的 KEY |
| aes-key-value | String | AES 使用的 KEY |
## RC4 加密算法
......@@ -27,4 +27,4 @@ weight = 4
| *名称* | *数据类型* | *说明* |
| ------------- | --------- | ------------- |
| rc4.key.value | String | RC4 使用的 KEY |
| rc4-key-value | String | RC4 使用的 KEY |
......@@ -17,7 +17,7 @@ Attributes:
| *Name* | *DataType* | *Description* |
| ------------- | ---------- | ------------- |
| aes.key.value | String | AES KEY |
| aes-key-value | String | AES KEY |
## RC4 Encrypt Algorithm
......@@ -27,4 +27,4 @@ Attributes:
| *Name* | *DataType* | *Description* |
| ------------- | ---------- | ------------- |
| rc4.key.value | String | RC4 KEY |
| rc4-key-value | String | RC4 KEY |
......@@ -11,9 +11,9 @@ weight = 2
| *属性名称* | *数据类型* | *说明* | *默认值* |
| --------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
| 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 (?) | 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 毫秒 |
## UUID
......
......@@ -11,9 +11,9 @@ 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, its value is `(2^n)-1`| 1 |
| 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, its value is `(2^n)-1`| 1 |
## UUID
......
......@@ -13,7 +13,7 @@ weight = 1
| *属性名称* | *数据类型* | *说明* |
| -------------- | --------- | ------- |
| sharding.count | int | 分片数量 |
| sharding-count | int | 分片数量 |
### 哈希取模分片算法
......@@ -23,7 +23,7 @@ weight = 1
| *属性名称* | *数据类型* | *说明* |
| -------------- | --------- | ------- |
| sharding.count | int | 分片数量 |
| sharding-count | int | 分片数量 |
### 基于分片容量的范围分片算法
......@@ -33,9 +33,9 @@ weight = 1
| *属性名称* | *数据类型* | *说明* |
| --------------- | --------- | -------------------------- |
| range.lower | long | 范围下界,超过边界的数据会报错 |
| range.upper | long | 范围上界,超过边界的数据会报错 |
| sharding.volume | long | 分片容量 |
| range-lower | long | 范围下界,超过边界的数据会报错 |
| range-upper | long | 范围上界,超过边界的数据会报错 |
| sharding-volume | long | 分片容量 |
### 基于分片边界的范围分片算法
......@@ -45,7 +45,7 @@ weight = 1
| *属性名称* | *数据类型* | *说明* |
| --------------- | --------- | --------------------------------- |
| sharding.ranges | String | 分片的范围边界,多个范围边界以逗号分隔 |
| sharding-ranges | String | 分片的范围边界,多个范围边界以逗号分隔 |
### 自动时间段分片算法
......@@ -55,9 +55,9 @@ weight = 1
| *属性名称* | *数据类型* | *说明* |
| ---------------- | --------- | ----------------------------------------------- |
| datetime.lower | String | 分片的起始时间范围,时间戳格式:yyyy-MM-dd HH:mm:ss |
| datetime.upper | String | 分片的结束时间范围,时间戳格式:yyyy-MM-dd HH:mm:ss |
| sharding.seconds | long | 单一分片所能承载的最大时间,单位:秒 |
| datetime-lower | String | 分片的起始时间范围,时间戳格式:yyyy-MM-dd HH:mm:ss |
| datetime-upper | String | 分片的结束时间范围,时间戳格式:yyyy-MM-dd HH:mm:ss |
| sharding-seconds | long | 单一分片所能承载的最大时间,单位:秒 |
## 标准分片算法
......@@ -71,8 +71,8 @@ Apache ShardingSphere 内置的标准分片算法实现类包括:
| *属性名称* | *数据类型* | *说明* | *默认值* |
| ----------------------------------------- | --------- | --------------------------------------------------- | ------- |
| algorithm.expression | String | 分片算法的行表达式 | - |
| allow.range.query.with.inline.sharding (?)| boolean | 是否允许范围查询。注意:范围查询会无视分片策略,进行全路由 | false |
| algorithm-expression | String | 分片算法的行表达式 | - |
| allow-range-query-with-inline-sharding (?)| boolean | 是否允许范围查询。注意:范围查询会无视分片策略,进行全路由 | false |
### 时间范围分片算法
......@@ -82,12 +82,12 @@ Apache ShardingSphere 内置的标准分片算法实现类包括:
| *属性名称* | *数据类型* | *说明* | *默认值* |
| ---------------------------- | --------- | -------------------------------------------------------------------------------- | ------- |
| datetime.pattern | String | 分片键的时间戳格式,必须遵循 Java DateTimeFormatter 的格式。例如:yyyy-MM-dd HH:mm:ss | - |
| datetime.lower | String | 时间分片下界值,格式与 `datetime.pattern` 定义的时间戳格式一致 | - |
| datetime.upper (?) | String | 时间分片上界值,格式与 `datetime.pattern` 定义的时间戳格式一致 | 当前时间 |
| sharding.suffix.pattern | String | 分片数据源或真实表的后缀格式,必须遵循 Java DateTimeFormatter 的格式。例如:yyyyMM | - |
| datetime.interval.amount (?) | int | 分片键时间间隔,超过该时间间隔将进入下一分片 | 1 |
| datetime.interval.unit (?) | String | 分片键时间间隔单位,必须遵循 Java ChronoUnit 的枚举值。例如:MONTHS | DAYS |
| datetime-pattern | String | 分片键的时间戳格式,必须遵循 Java DateTimeFormatter 的格式。例如:yyyy-MM-dd HH:mm:ss | - |
| datetime-lower | String | 时间分片下界值,格式与 `datetime-pattern` 定义的时间戳格式一致 | - |
| datetime-upper (?) | String | 时间分片上界值,格式与 `datetime-pattern` 定义的时间戳格式一致 | 当前时间 |
| sharding-suffix-pattern | String | 分片数据源或真实表的后缀格式,必须遵循 Java DateTimeFormatter 的格式。例如:yyyyMM | - |
| datetime-interval-amount (?) | int | 分片键时间间隔,超过该时间间隔将进入下一分片 | 1 |
| datetime-interval-unit (?) | String | 分片键时间间隔单位,必须遵循 Java ChronoUnit 的枚举值。例如:MONTHS | DAYS |
## 复合分片算法
......
......@@ -13,7 +13,7 @@ Attributes:
| *Name* | *DataType* | *Description* |
| -------------- | ---------- | -------------- |
| sharding.count | int | Sharding count |
| sharding-count | int | Sharding count |
### Hash Modulo Sharding Algorithm
......@@ -23,7 +23,7 @@ Attributes:
| *Name* | *DataType* | *Description* |
| -------------- | ---------- | -------------- |
| sharding.count | int | Sharding count |
| sharding-count | int | Sharding count |
### Volume Based Range Sharding Algorithm
......@@ -33,9 +33,9 @@ Attributes:
| *Name* | *DataType* | *Description* |
| --------------- | ---------- | ------------------------------------------------------ |
| range.lower | long | Range lower bound, throw exception if lower than bound |
| range.upper | long | Range upper bound, throw exception if upper than bound |
| sharding.volume | long | Sharding volume |
| range-lower | long | Range lower bound, throw exception if lower than bound |
| range-upper | long | Range upper bound, throw exception if upper than bound |
| sharding-volume | long | Sharding volume |
### Boundary Based Range Sharding Algorithm
......@@ -45,7 +45,7 @@ Attributes:
| *Name* | *DataType* | *Description* |
| --------------- | ---------- | ----------------------------------------------------------------- |
| sharding.ranges | String | Range of sharding border, multiple boundaries separated by commas |
| sharding-ranges | String | Range of sharding border, multiple boundaries separated by commas |
### Auto Interval Sharding Algorithm
......@@ -55,9 +55,9 @@ Attributes:
| *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 |
| sharding.seconds | long | Max seconds for the data in one shard |
| 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 |
| sharding-seconds | long | Max seconds for the data in one shard |
## Standard Sharding Algorithm
......@@ -71,8 +71,8 @@ Attributes:
| *Name* | *DataType* | *Description* | *Default Value* |
| ----------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------- | --------------- |
| algorithm.expression | String | Inline expression sharding algorithm | - |
| allow.range.query.with.inline.sharding (?)| boolean | Whether range query is allowed. Note: range query will ignore sharding strategy and conduct full routing | false |
| algorithm-expression | String | Inline expression sharding algorithm | - |
| allow-range-query-with-inline-sharding (?)| boolean | Whether range query is allowed. Note: range query will ignore sharding strategy and conduct full routing | false |
### Interval Sharding Algorithm
......@@ -82,12 +82,12 @@ Attributes:
| *Name* | *DataType* | *Description* | *Default Value* |
| ---------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------- | --------------- |
| datetime.pattern | String | Timestamp pattern of sharding value, must can be transformed to Java LocalDateTime. For example: yyyy-MM-dd HH:mm:ss | - |
| datetime.lower | String | Datetime sharding lower boundary, pattern is defined `datetime.pattern` | - |
| datetime.upper (?) | String | Datetime sharding upper boundary, pattern is defined `datetime.pattern` | Now |
| sharding.suffix.pattern | String | Suffix pattern of sharding data sources or tables, must can be transformed to Java LocalDateTime. For example: yyyyMM | - |
| datetime.interval.amount (?) | int | Interval of sharding value | 1 |
| datetime.interval.unit (?) | String | Unit of sharding value interval, must can be transformed to Java ChronoUnit's Enum value. For example: MONTHS | DAYS |
| datetime-pattern | String | Timestamp pattern of sharding value, must can be transformed to Java LocalDateTime. For example: yyyy-MM-dd HH:mm:ss | - |
| datetime-lower | String | Datetime sharding lower boundary, pattern is defined `datetime-pattern` | - |
| datetime-upper (?) | String | Datetime sharding upper boundary, pattern is defined `datetime-pattern` | Now |
| sharding-suffix-pattern | String | Suffix pattern of sharding data sources or tables, must can be transformed to Java LocalDateTime. For example: yyyyMM | - |
| datetime-interval-amount (?) | int | Interval of sharding value | 1 |
| datetime-interval-unit (?) | String | Unit of sharding value interval, must can be transformed to Java ChronoUnit's Enum value. For example: MONTHS | DAYS |
## Complex Sharding Algorithm
......
......@@ -57,12 +57,12 @@ shardingRuleConfig.getTables().add(orderTableRuleConfig);
// 配置分库算法
Properties dbShardingAlgorithmrProps = new Properties();
dbShardingAlgorithmrProps.setProperty("algorithm.expression", "ds${user_id % 2}");
dbShardingAlgorithmrProps.setProperty("algorithm-expression", "ds${user_id % 2}");
shardingRuleConfig.getShardingAlgorithms().put("dbShardingAlgorithm", new ShardingSphereAlgorithmConfiguration("INLINE", dbShardingAlgorithmrProps));
// 配置分表算法
Properties tableShardingAlgorithmrProps = new Properties();
tableShardingAlgorithmrProps.setProperty("algorithm.expression", "t_order${order_id % 2}");
tableShardingAlgorithmrProps.setProperty("algorithm-expression", "t_order${order_id % 2}");
shardingRuleConfig.getShardingAlgorithms().put("tableShardingAlgorithm", new ShardingSphereAlgorithmConfiguration("INLINE", tableShardingAlgorithmrProps));
// 创建 ShardingSphereDataSource
......
......@@ -58,12 +58,12 @@ shardingRuleConfig.getTables().add(orderTableRuleConfig);
// Configure database sharding algorithm
Properties dbShardingAlgorithmrProps = new Properties();
dbShardingAlgorithmrProps.setProperty("algorithm.expression", "ds${user_id % 2}");
dbShardingAlgorithmrProps.setProperty("algorithm-expression", "ds${user_id % 2}");
shardingRuleConfig.getShardingAlgorithms().put("dbShardingAlgorithm", new ShardingSphereAlgorithmConfiguration("INLINE", dbShardingAlgorithmrProps));
// Configure table sharding algorithm
Properties tableShardingAlgorithmrProps = new Properties();
tableShardingAlgorithmrProps.setProperty("algorithm.expression", "t_order${order_id % 2}");
tableShardingAlgorithmrProps.setProperty("algorithm-expression", "t_order${order_id % 2}");
shardingRuleConfig.getShardingAlgorithms().put("tableShardingAlgorithm", new ShardingSphereAlgorithmConfiguration("INLINE", tableShardingAlgorithmrProps));
// Create ShardingSphereDataSource
......
......@@ -49,9 +49,9 @@ spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.shar
# 配置 分片算法
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_${user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_${user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.table_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.table_inline.props.algorithm.expression=t_order_${order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.table_inline.props.algorithm-expression=t_order_${order_id % 2}
```
......
......@@ -49,9 +49,9 @@ spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.shar
# Configure sharding algorithm
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_${user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_${user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.table_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.table_inline.props.algorithm.expression=t_order_${order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.table_inline.props.algorithm-expression=t_order_${order_id % 2}
```
### Use JNDI Data Source
......
......@@ -44,7 +44,7 @@ weight = 4
<!-- 配置分库策略 -->
<sharding:sharding-algorithm id="dbShardingAlgorithm" type="INLINE">
<properties>
<prop key="algorithm.expression">ds$->{user_id % 2}</prop>
<prop key="algorithm-expression">ds$->{user_id % 2}</prop>
</properties>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="dbStrategy" sharding-column="user_id" algorithm-ref="dbShardingAlgorithm" />
......@@ -52,7 +52,7 @@ weight = 4
<!-- 配置分表策略 -->
<sharding:sharding-algorithm id="tableShardingAlgorithm" type="INLINE">
<properties>
<prop key="algorithm.expression">t_order$->{order_id % 2}</prop>
<prop key="algorithm-expression">t_order$->{order_id % 2}</prop>
</properties>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="tableStrategy" sharding-column="user_id" algorithm-ref="tableShardingAlgorithm" />
......
......@@ -44,7 +44,7 @@ weight = 4
<!-- Configure database sharding strategy -->
<sharding:sharding-algorithm id="dbShardingAlgorithm" type="INLINE">
<properties>
<prop key="algorithm.expression">ds$->{user_id % 2}</prop>
<prop key="algorithm-expression">ds$->{user_id % 2}</prop>
</properties>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="dbStrategy" sharding-column="user_id" algorithm-ref="dbShardingAlgorithm" />
......@@ -52,7 +52,7 @@ weight = 4
<!-- Configure table sharding strategy -->
<sharding:sharding-algorithm id="tableShardingAlgorithm" type="INLINE">
<properties>
<prop key="algorithm.expression">t_order$->{order_id % 2}</prop>
<prop key="algorithm-expression">t_order$->{order_id % 2}</prop>
</properties>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="tableStrategy" sharding-column="user_id" algorithm-ref="tableShardingAlgorithm" />
......
......@@ -60,11 +60,11 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds${user_id % 2}
algorithm-expression: ds${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
```
```java
......
......@@ -61,11 +61,11 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds${user_id % 2}
algorithm-expression: ds${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
```
```java
......
......@@ -75,12 +75,12 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
t_order_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
t_order_item_inline:
type: INLINE
props:
algorithm.expression: t_order_item_${order_id % 2}
algorithm-expression: t_order_item_${order_id % 2}
......@@ -57,7 +57,7 @@ public final class LocalEncryptConfiguration implements ExampleConfiguration {
private ShardingSphereAlgorithmConfiguration createEncryptAlgorithmConfiguration() {
Properties props = new Properties();
props.setProperty("aes.key.value", "123456");
props.setProperty("aes-key-value", "123456");
return new ShardingSphereAlgorithmConfiguration("AES", props);
}
}
......@@ -61,7 +61,7 @@ public final class LocalShardingDatabasesAndTablesConfiguration implements Examp
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "inline"));
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
Properties props = new Properties();
props.setProperty("algorithm.expression", "demo_ds_${user_id % 2}");
props.setProperty("algorithm-expression", "demo_ds_${user_id % 2}");
result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
......@@ -87,7 +87,7 @@ public final class LocalShardingDatabasesAndTablesConfiguration implements Examp
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -60,7 +60,7 @@ public final class LocalShardingDatabasesConfiguration implements ExampleConfigu
result.getBroadcastTables().add("t_address");
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "inline"));
Properties props = new Properties();
props.setProperty("algorithm.expression", "demo_ds_${user_id % 2}");
props.setProperty("algorithm-expression", "demo_ds_${user_id % 2}");
result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProps()));
return result;
......@@ -85,7 +85,7 @@ public final class LocalShardingDatabasesConfiguration implements ExampleConfigu
private static Properties getProps() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -94,7 +94,7 @@ public final class LocalShardingMasterSlaveConfiguration implements ExampleConfi
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
......
......@@ -82,7 +82,7 @@ public final class LocalShardingTablesConfiguration implements ExampleConfigurat
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -34,7 +34,7 @@ rules:
status_encryptor:
type: AES
props:
aes.key.value: 123456
aes-key-value: 123456
props:
query.with.cipher.column: true
......
......@@ -61,21 +61,21 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
t_order_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
t_order_item_inline:
type: INLINE
props:
algorithm.expression: t_order_item_${order_id % 2}
algorithm-expression: t_order_item_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: true
......
......@@ -41,7 +41,7 @@ rules:
status_encryptor:
type: AES
props:
aes.key.value: 123456
aes-key-value: 123456
props:
query.with.cipher.column: true
......
......@@ -68,21 +68,21 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
t_order_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
t_order_item_inline:
type: INLINE
props:
algorithm.expression: t_order_item_${order_id % 2}
algorithm-expression: t_order_item_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: true
......@@ -24,7 +24,7 @@ spring.shardingsphere.datasource.ds_encrypt.username=root
spring.shardingsphere.datasource.ds_encrypt.password=
spring.shardingsphere.rules.encrypt.encryptors.status_encryptor.type=AES
spring.shardingsphere.rules.encrypt.encryptors.status_encryptor.props.aes.key.value=123456
spring.shardingsphere.rules.encrypt.encryptors.status_encryptor.props.aes-key-value=123456
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.cipher-column=status
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.encryptor-name=status_encryptor
......
......@@ -48,14 +48,14 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.c
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm.expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm-expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
spring.shardingsphere.governance.name=demo1_spring_boot_ds_sharding
spring.shardingsphere.governance.overwrite=true
......
......@@ -24,7 +24,7 @@ spring.shardingsphere.datasource.ds_encrypt.username=root
spring.shardingsphere.datasource.ds_encrypt.password=
spring.shardingsphere.rules.encrypt.encryptors.status_encryptor.type=AES
spring.shardingsphere.rules.encrypt.encryptors.status_encryptor.props.aes.key.value=123456
spring.shardingsphere.rules.encrypt.encryptors.status_encryptor.props.aes-key-value=123456
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.cipher-column=status
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.encryptor-name=status_encryptor
......
......@@ -48,17 +48,17 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.c
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm.expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm-expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
spring.shardingsphere.rules.encrypt.encryptors.status_encryptor.type=AES
spring.shardingsphere.rules.encrypt.encryptors.status_encryptor.props.aes.key.value=123456
spring.shardingsphere.rules.encrypt.encryptors.status_encryptor.props.aes-key-value=123456
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.cipher-column=status
spring.shardingsphere.rules.encrypt.tables.t_order.columns.status.encryptor-name=status_encryptor
......
......@@ -48,7 +48,7 @@
<encrypt:encrypt-algorithm id="name_encryptor" type="AES">
<props>
<prop key="aes.key.value">123456</prop>
<prop key="aes-key-value">123456</prop>
</props>
</encrypt:encrypt-algorithm>
<encrypt:encrypt-algorithm id="pwd_encryptor" type="MD5" />
......
......@@ -55,17 +55,17 @@
<sharding:sharding-algorithm id="databaseInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:sharding-algorithm id="orderInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:sharding-algorithm id="orderItemInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_item_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_item_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
......@@ -75,7 +75,7 @@
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -48,7 +48,7 @@
<encrypt:encrypt-algorithm id="name_encryptor" type="AES">
<props>
<prop key="aes.key.value">123456</prop>
<prop key="aes-key-value">123456</prop>
</props>
</encrypt:encrypt-algorithm>
<encrypt:encrypt-algorithm id="pwd_encryptor" type="assistedTest" />
......
......@@ -54,19 +54,19 @@
<sharding:sharding-algorithm id="databaseInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:sharding-algorithm id="orderInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:sharding-algorithm id="orderItemInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_item_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_item_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
......@@ -78,7 +78,7 @@
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -38,7 +38,7 @@ public final class EncryptDatabasesConfiguration implements ExampleConfiguration
@Override
public DataSource getDataSource() {
Properties props = new Properties();
props.setProperty("aes.key.value", "123456");
props.setProperty("aes-key-value", "123456");
props.setProperty("query.with.cipher.column", "true");
EncryptColumnRuleConfiguration columnConfigAes = new EncryptColumnRuleConfiguration("user_name", "user_name", "", "user_name_plain", "name_encryptor");
EncryptColumnRuleConfiguration columnConfigTest = new EncryptColumnRuleConfiguration("pwd", "pwd", "assisted_query_pwd", "", "pwd_encryptor");
......
......@@ -39,7 +39,7 @@ rules:
name_encryptor:
type: AES
props:
aes.key.value: 123456
aes-key-value: 123456
pwd_encryptor:
type: assistedTest
......
......@@ -24,7 +24,7 @@ spring.shardingsphere.datasource.ds.username=root
spring.shardingsphere.datasource.ds.password=
spring.shardingsphere.rules.encrypt.encryptors.name_encryptor.type=AES
spring.shardingsphere.rules.encrypt.encryptors.name_encryptor.props.aes.key.value=123456
spring.shardingsphere.rules.encrypt.encryptors.name_encryptor.props.aes-key-value=123456
spring.shardingsphere.rules.encrypt.encryptors.pwd_encryptor.type=assistedTest
spring.shardingsphere.rules.encrypt.tables.t_user.columns.user_name.cipher-column=user_name
spring.shardingsphere.rules.encrypt.tables.t_user.columns.user_name.plain-column=user_name_plain
......
......@@ -44,7 +44,7 @@
<encrypt:encrypt-algorithm id="name_encryptor" type="AES">
<props>
<prop key="aes.key.value">123456</prop>
<prop key="aes-key-value">123456</prop>
</props>
</encrypt:encrypt-algorithm>
<encrypt:encrypt-algorithm id="pwd_encryptor" type="assistedTest" />
......
......@@ -61,13 +61,13 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: true
......@@ -64,7 +64,7 @@ public final class EncryptShadowDatabasesConfiguration implements ExampleConfigu
private Map<String, ShardingSphereAlgorithmConfiguration> getEncryptAlgorithmConfigurations() {
Map<String, ShardingSphereAlgorithmConfiguration> result = new LinkedHashMap<>(2, 1);
Properties props = new Properties();
props.setProperty("aes.key.value", "123456");
props.setProperty("aes-key-value", "123456");
result.put("name_encryptor", new ShardingSphereAlgorithmConfiguration("AES", props));
result.put("pwd_encryptor", new ShardingSphereAlgorithmConfiguration("assistedTest", null));
return result;
......
......@@ -49,10 +49,10 @@ public final class ShardingShadowDatabasesConfiguration implements ExampleConfig
ShardingRuleConfiguration shardingRuleConfiguration = new ShardingRuleConfiguration();
shardingRuleConfiguration.getTables().add(getUserTableConfiguration());
Properties props = new Properties();
props.setProperty("algorithm.expression", "ds_${user_id % 2}");
props.setProperty("algorithm-expression", "ds_${user_id % 2}");
shardingRuleConfiguration.getShardingAlgorithms() .put("database_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_user");
props.setProperty("algorithm-expression", "t_user");
shardingRuleConfiguration.getShardingAlgorithms() .put("table_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props.setProperty("sql.show", "true");
ShadowRuleConfiguration shadowRuleConfiguration = new ShadowRuleConfiguration("shadow", shadowMappings);
......@@ -68,13 +68,13 @@ public final class ShardingShadowDatabasesConfiguration implements ExampleConfig
private StandardShardingStrategyConfiguration getTableStandardShardingStrategyConfiguration() {
InlineShardingAlgorithm inlineShardingAlgorithm = new InlineShardingAlgorithm();
inlineShardingAlgorithm.getProps().setProperty("algorithm.expression", "t_user");
inlineShardingAlgorithm.getProps().setProperty("algorithm-expression", "t_user");
return new StandardShardingStrategyConfiguration("user_id", "table_inline");
}
private StandardShardingStrategyConfiguration getDatabaseStandardShardingStrategyConfiguration() {
InlineShardingAlgorithm inlineShardingAlgorithm = new InlineShardingAlgorithm();
inlineShardingAlgorithm.getProps().setProperty("algorithm.expression", "ds_${user_id % 2}");
inlineShardingAlgorithm.getProps().setProperty("algorithm-expression", "ds_${user_id % 2}");
return new StandardShardingStrategyConfiguration("user_id", "database_inline");
}
}
......@@ -49,7 +49,7 @@ rules:
name_encryptor:
type: AES
props:
aes.key.value: 123456
aes-key-value: 123456
pwd_encryptor:
type: assistedTest
......
......@@ -65,11 +65,11 @@ shardingAlgorithms:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_user
algorithm-expression: t_user
props:
sql.show: true
......@@ -30,7 +30,7 @@ spring.shardingsphere.rules.shadow.column=shadow
spring.shardingsphere.rules.shadow.shadow-mappings.ds=shadow_ds
spring.shardingsphere.rules.encrypt.encryptors.name_encryptor.type=AES
spring.shardingsphere.rules.encrypt.encryptors.name_encryptor.props.aes.key.value=123456
spring.shardingsphere.rules.encrypt.encryptors.name_encryptor.props.aes-key-value=123456
spring.shardingsphere.rules.encrypt.encryptors.pwd_encryptor.type=assistedTest
spring.shardingsphere.rules.encrypt.tables.t_shadow_user.columns.user_name.cipher-column=user_name
spring.shardingsphere.rules.encrypt.tables.t_shadow_user.columns.user_name.plain-column=user_name_plain
......
......@@ -43,7 +43,7 @@ spring.shardingsphere.rules.sharding.tables.t_shadow_user.key-generate-strategy.
spring.shardingsphere.rules.sharding.tables.t_shadow_user.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -60,7 +60,7 @@
<encrypt:encrypt-algorithm id="name_encryptor" type="AES">
<props>
<prop key="aes.key.value">123456</prop>
<prop key="aes-key-value">123456</prop>
</props>
</encrypt:encrypt-algorithm>
<encrypt:encrypt-algorithm id="pwd_encryptor" type="assistedTest" />
......
......@@ -76,7 +76,7 @@
<sharding:sharding-algorithm id="inlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">ds_${user_id % 2}</prop>
<prop key="algorithm-expression">ds_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
......
......@@ -49,7 +49,7 @@ public final class ShardingDatabasesAndTablesConfigurationPrecise implements Exa
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "inline"));
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
Properties props = new Properties();
props.setProperty("algorithm.expression", "demo_ds_${user_id % 2}");
props.setProperty("algorithm-expression", "demo_ds_${user_id % 2}");
result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
......@@ -77,7 +77,7 @@ public final class ShardingDatabasesAndTablesConfigurationPrecise implements Exa
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -75,7 +75,7 @@ public final class ShardingDatabasesAndTablesConfigurationRange implements Examp
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -47,7 +47,7 @@ public final class ShardingDatabasesConfigurationPrecise implements ExampleConfi
result.getBroadcastTables().add("t_address");
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "inline"));
Properties props = new Properties();
props.setProperty("algorithm.expression", "demo_ds_${user_id % 2}");
props.setProperty("algorithm-expression", "demo_ds_${user_id % 2}");
result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
......@@ -74,7 +74,7 @@ public final class ShardingDatabasesConfigurationPrecise implements ExampleConfi
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -77,7 +77,7 @@ public final class ShardingDatabasesConfigurationRange implements ExampleConfigu
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -90,7 +90,7 @@ public final class ShardingMasterSlaveConfigurationPrecise implements ExampleCon
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -90,7 +90,7 @@ public final class ShardingMasterSlaveConfigurationRange implements ExampleConfi
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -72,7 +72,7 @@ public final class ShardingTablesConfigurationPrecise implements ExampleConfigur
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -72,7 +72,7 @@ public final class ShardingTablesConfigurationRange implements ExampleConfigurat
private static Properties getProperties() {
Properties result = new Properties();
result.setProperty("worker.id", "123");
result.setProperty("worker-id", "123");
return result;
}
}
......@@ -59,7 +59,7 @@ rules:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -69,7 +69,7 @@ rules:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -63,21 +63,21 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
t_order_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
t_order_item_inline:
type: INLINE
props:
algorithm.expression: t_order_item_${order_id % 2}
algorithm-expression: t_order_item_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -55,13 +55,13 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -87,7 +87,7 @@ rules:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
- !MASTER_SLAVE
dataSources:
......
......@@ -81,21 +81,21 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
t_order_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
t_order_item_inline:
type: INLINE
props:
algorithm.expression: t_order_item_${order_id % 2}
algorithm-expression: t_order_item_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
- !MASTER_SLAVE
dataSources:
......
......@@ -56,7 +56,7 @@ rules:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -52,17 +52,17 @@ rules:
t_order_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
t_order_item_inline:
type: INLINE
props:
algorithm.expression: t_order_item_${order_id % 2}
algorithm-expression: t_order_item_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -46,11 +46,11 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.c
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm.expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm-expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -41,7 +41,7 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.c
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -51,7 +51,7 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.c
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
spring.shardingsphere.rules.master-slaves.ds_0.master-data-source-name=ds_master_0
spring.shardingsphere.rules.master-slaves.ds_0.slave-data-source-names=ds_master_0_slave_0, ds_master_0_slave_1
......
......@@ -42,9 +42,9 @@ spring.shardingsphere.rules.sharding.binding-tables=t_order,t_order_item
spring.shardingsphere.rules.sharding.broadcast-tables=t_address
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm.expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm-expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -46,11 +46,11 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.c
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm.expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm-expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -41,7 +41,7 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.c
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -54,7 +54,7 @@ spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.c
spring.shardingsphere.rules.sharding.tables.t_order_item.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
spring.shardingsphere.rules.master-slave.data-sources.ds_0.master-data-source-name=ds_master_0
spring.shardingsphere.rules.master-slave.data-sources.ds_0.slave-data-source-names=ds_master_0_slave_0, ds_master_0_slave_1
......
......@@ -41,9 +41,9 @@ spring.shardingsphere.rules.sharding.binding-tables=t_order,t_order_item
spring.shardingsphere.rules.sharding.broadcast-tables=t_address
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm.expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_item_inline.props.algorithm-expression=t_order_item_$->{order_id % 2}
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -72,28 +72,28 @@
<sharding:sharding-algorithm id="databaseAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="databaseStrategy" sharding-column="user_id" algorithm-ref="databaseAlgorithm" />
<sharding:sharding-algorithm id="orderTableAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="orderTableStrategy" sharding-column="order_id" algorithm-ref="orderTableAlgorithm" />
<sharding:sharding-algorithm id="orderItemTableAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_item_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_item_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="orderItemTableStrategy" sharding-column="order_id" algorithm-ref="orderItemTableAlgorithm" />
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -70,14 +70,14 @@
<sharding:sharding-algorithm id="databaseAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="databaseStrategy" sharding-column="user_id" algorithm-ref="databaseAlgorithm" />
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -109,28 +109,28 @@
<sharding:sharding-algorithm id="databaseAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_ms_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_ms_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="databaseStrategy" sharding-column="user_id" algorithm-ref="databaseAlgorithm" />
<sharding:sharding-algorithm id="orderTableAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="orderTableStrategy" sharding-column="order_id" algorithm-ref="orderTableAlgorithm" />
<sharding:sharding-algorithm id="orderItemTableAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_item_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_item_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="orderItemTableStrategy" sharding-column="order_id" algorithm-ref="orderItemTableAlgorithm" />
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -63,21 +63,21 @@
<sharding:sharding-algorithm id="orderTableAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="orderTableStrategy" sharding-column="order_id" algorithm-ref="orderTableAlgorithm" />
<sharding:sharding-algorithm id="orderItemTableAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_item_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_item_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:standard-strategy id="orderItemTableStrategy" sharding-column="order_id" algorithm-ref="orderItemTableAlgorithm" />
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -55,23 +55,23 @@
<sharding:sharding-algorithm id="inlineDatabaseStrategyAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:sharding-algorithm id="inlineOrderTableStrategyAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:sharding-algorithm id="inlineOrderItemTableStrategyAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_item_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_item_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -53,13 +53,13 @@
<sharding:sharding-algorithm id="inlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -86,23 +86,23 @@
<sharding:sharding-algorithm id="inlineDatabaseStrategyAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_ms_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_ms_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:sharding-algorithm id="inlineOrderTableStrategyAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:sharding-algorithm id="inlineOrderItemTableStrategyAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_item_${order_item_id % 2}</prop>
<prop key="algorithm-expression">t_order_item_${order_item_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -47,18 +47,18 @@
<sharding:sharding-algorithm id="inlineOrderTableStrategyAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:sharding-algorithm id="inlineOrderItemTableStrategyAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_item_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_item_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -53,17 +53,17 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -53,17 +53,17 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -49,17 +49,17 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -52,17 +52,17 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -49,17 +49,17 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -52,17 +52,17 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -29,16 +29,16 @@ spring.shardingsphere.datasource.ds_1.jdbc-url=jdbc:mysql://localhost:3306/demo_
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=user_id
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=database_inline
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds_$->{0..1}.t_order_$->{0..1}
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t_order_inline
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -29,7 +29,7 @@ spring.shardingsphere.datasource.ds_1.jdbc-url=jdbc:mysql://localhost:3306/demo_
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=database_inline
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=user_id
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds_$->{0..1}.t_order
......@@ -37,4 +37,4 @@ spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -27,10 +27,10 @@ spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds.t_order
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t_order_inline
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -53,12 +53,12 @@
</bean>
<bean:properties id="databaseInlineProps">
<prop key="algorithm.expression">demo_ds_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
</bean:properties>
<sharding:sharding-algorithm id="databaseInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
......@@ -66,7 +66,7 @@
<sharding:sharding-algorithm id="orderInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
......@@ -74,7 +74,7 @@
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -51,7 +51,7 @@
<sharding:sharding-algorithm id="databaseInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">demo_ds_${user_id % 2}</prop>
<prop key="algorithm-expression">demo_ds_${user_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
......@@ -59,7 +59,7 @@
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -44,7 +44,7 @@
<sharding:sharding-algorithm id="orderInlineStrategyShardingAlgorithm" type="INLINE">
<props>
<prop key="algorithm.expression">t_order_${order_id % 2}</prop>
<prop key="algorithm-expression">t_order_${order_id % 2}</prop>
</props>
</sharding:sharding-algorithm>
......@@ -52,7 +52,7 @@
<sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
<props>
<prop key="worker.id">123</prop>
<prop key="worker-id">123</prop>
</props>
</sharding:key-generate-algorithm>
......
......@@ -51,17 +51,17 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
table_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
props:
sql.show: false
......@@ -29,16 +29,16 @@ spring.shardingsphere.datasource.ds_1.jdbc-url=jdbc:mysql://localhost:3306/demo_
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=user_id
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=database_inline
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds_$->{0..1}.t_order_$->{0..1}
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t_order_inline
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -29,7 +29,7 @@ spring.shardingsphere.datasource.ds_1.jdbc-url=jdbc:mysql://localhost:3306/demo_
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-column=user_id
spring.shardingsphere.rules.sharding.default-database-strategy.standard.sharding-algorithm-name=database_inline
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm.expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression=ds_$->{user_id % 2}
spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds_$->{0..1}.t_order
......@@ -37,4 +37,4 @@ spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -27,10 +27,10 @@ spring.shardingsphere.rules.sharding.tables.t_order.actual-data-nodes=ds.t_order
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-column=order_id
spring.shardingsphere.rules.sharding.tables.t_order.table-strategy.standard.sharding-algorithm-name=t_order_inline
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.type=INLINE
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm.expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.sharding-algorithms.t_order_inline.props.algorithm-expression=t_order_$->{order_id % 2}
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.column=order_id
spring.shardingsphere.rules.sharding.tables.t_order.key-generate-strategy.key-generator-name=snowflake
spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker.id=123
spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
......@@ -79,18 +79,18 @@ rules:
database_inline:
type: INLINE
props:
algorithm.expression: ds_${user_id % 2}
algorithm-expression: ds_${user_id % 2}
t_order_inline:
type: INLINE
props:
algorithm.expression: t_order_${order_id % 2}
algorithm-expression: t_order_${order_id % 2}
t_order_item_inline:
type: INLINE
props:
algorithm.expression: t_order_item_${order_id % 2}
algorithm-expression: t_order_item_${order_id % 2}
keyGenerators:
snowflake:
type: SNOWFLAKE
props:
worker.id: 123
worker-id: 123
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册