forked from apache/shardingsphere-doc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
result_version_shardingsphere
166 lines (166 loc) · 8 KB
/
result_version_shardingsphere
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
1,3c1,3
< commit 91992382630be957694eb268f219e1ac2f49e568
< Author: Xiaoshuang Li <[email protected]>
< Date: Wed Nov 18 17:24:56 2020 +0800
---
> commit 88f6d93b09ec64bbb59f631fe00c1e8b3448c5ff
> Author: yu199195 <[email protected]>
> Date: Thu Nov 19 14:55:44 2020 +0800
5,7c5
< Modify the sample (#8205)
<
< Modify the sample
---
> fix spring namespace doc
9,15c7,72
< diff --git a/docs/document/content/features/sharding/concept/inline-expression.cn.md b/docs/document/content/features/sharding/concept/inline-expression.cn.md
< index aef4796b7d..8c53c1b2f9 100644
< --- a/docs/document/content/features/sharding/concept/inline-expression.cn.md
< +++ b/docs/document/content/features/sharding/concept/inline-expression.cn.md
< @@ -142,7 +142,7 @@ db${0..1}.t_order_0${0..9}, db${0..1}.t_order_${10..20}
< 或者
<
---
> diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.cn.md
> index 4eddf149aa..0ed852f1d8 100644
> --- a/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.cn.md
> +++ b/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.cn.md
> @@ -43,32 +43,48 @@ weight = 4
>
> <!-- 配置分库策略 -->
> <sharding:sharding-algorithm id="dbShardingAlgorithm" type="INLINE">
> - <properties>
> + <props>
> <prop key="algorithm-expression">ds$->{user_id % 2}</prop>
> - </properties>
> + </props>
> </sharding:sharding-algorithm>
> <sharding:standard-strategy id="dbStrategy" sharding-column="user_id" algorithm-ref="dbShardingAlgorithm" />
>
> <!-- 配置分表策略 -->
> <sharding:sharding-algorithm id="tableShardingAlgorithm" type="INLINE">
> - <properties>
> + <props>
> <prop key="algorithm-expression">t_order$->{order_id % 2}</prop>
> - </properties>
> + </props>
> </sharding:sharding-algorithm>
> <sharding:standard-strategy id="tableStrategy" sharding-column="user_id" algorithm-ref="tableShardingAlgorithm" />
> +
> + <!-- 配置分布式id生成策略 -->
> + <sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
> + <props>
> + <prop key="worker-id">123</prop>
> + </props>
> + </sharding:key-generate-algorithm>
> + <sharding:key-generate-strategy id="orderKeyGenerator" column="order_id" algorithm-ref="snowflakeAlgorithm" />
> +
> + <!-- 配置sharding策略 -->
> + <sharding:rule id="shardingRule">
> + <sharding:table-rules>
> + <sharding:table-rule logic-table="t_order" actual-data-nodes="ds${0..1}.t_order_${0..1}" database-strategy-ref="dbStrategy" table-strategy-ref="tableStrategy" key-generate-strategy-ref="orderKeyGenerator" />
> + </sharding:table-rules>
> + <sharding:binding-table-rules>
> + <sharding:binding-table-rule logic-tables="t_order,t_order_item"/>
> + </sharding:binding-table-rules>
> + <sharding:broadcast-table-rules>
> + <sharding:broadcast-table-rule table="t_address"/>
> + </sharding:broadcast-table-rules>
> + </sharding:rule>
>
> <!-- 配置ShardingSphereDataSource -->
> - <sharding:data-source id="shardingDataSource">
> - <!-- 配置分片规则 -->
> - <sharding:sharding-rule data-source-names="ds0,ds1">
> - <sharding:table-rules>
> - <!-- 配置 t_order 表规则 -->
> - <sharding:table-rule logic-table="t_order" actual-data-nodes="ds$->{0..1}.t_order$->{0..1}" database-strategy-ref="dbStrategy" table-strategy-ref="tableStrategy" />
> - <!-- 省略配置 t_order_item 表规则... -->
> - <!-- ... -->
> - </sharding:table-rules>
> - </sharding:sharding-rule>
> - </sharding:data-source>
> + <shardingsphere:data-source id="shardingDataSource" data-source-names="ds0, ds1" rule-refs="shardingRule">
> + <props>
> + <prop key="sql-show">false</prop>
> + </props>
> + </shardingsphere:data-source>
> +
> </beans>
17,18c74,144
< -db->${0..1}.t_order_0$->{0..9}, db$->{0..1}.t_order_$->{10..20}
< +db$->{0..1}.t_order_0$->{0..9}, db$->{0..1}.t_order_$->{10..20}
---
>
> diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.en.md
> index 3b8ce4dec3..65b2ce8ff9 100644
> --- a/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.en.md
> +++ b/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.en.md
> @@ -43,32 +43,48 @@ weight = 4
>
> <!-- Configure database sharding strategy -->
> <sharding:sharding-algorithm id="dbShardingAlgorithm" type="INLINE">
> - <properties>
> - <prop key="algorithm-expression">ds$->{user_id % 2}</prop>
> - </properties>
> + <props>
> + <prop key="algorithm-expression">ds$->{user_id % 2}</prop>
> + </props>
> </sharding:sharding-algorithm>
> <sharding:standard-strategy id="dbStrategy" sharding-column="user_id" algorithm-ref="dbShardingAlgorithm" />
> -
> +
> <!-- Configure table sharding strategy -->
> <sharding:sharding-algorithm id="tableShardingAlgorithm" type="INLINE">
> - <properties>
> - <prop key="algorithm-expression">t_order$->{order_id % 2}</prop>
> - </properties>
> + <props>
> + <prop key="algorithm-expression">t_order$->{order_id % 2}</prop>
> + </props>
> </sharding:sharding-algorithm>
> <sharding:standard-strategy id="tableStrategy" sharding-column="user_id" algorithm-ref="tableShardingAlgorithm" />
> -
> +
> + <!-- Configure distributed key-generate strategy -->
> + <sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE">
> + <props>
> + <prop key="worker-id">123</prop>
> + </props>
> + </sharding:key-generate-algorithm>
> + <sharding:key-generate-strategy id="orderKeyGenerator" column="order_id" algorithm-ref="snowflakeAlgorithm" />
> +
> + <!-- Configure sharding rule -->
> + <sharding:rule id="shardingRule">
> + <sharding:table-rules>
> + <sharding:table-rule logic-table="t_order" actual-data-nodes="ds${0..1}.t_order_${0..1}" database-strategy-ref="dbStrategy" table-strategy-ref="tableStrategy" key-generate-strategy-ref="orderKeyGenerator" />
> + </sharding:table-rules>
> + <sharding:binding-table-rules>
> + <sharding:binding-table-rule logic-tables="t_order,t_order_item"/>
> + </sharding:binding-table-rules>
> + <sharding:broadcast-table-rules>
> + <sharding:broadcast-table-rule table="t_address"/>
> + </sharding:broadcast-table-rules>
> + </sharding:rule>
> +
> <!-- Configure ShardingSphereDataSource -->
> - <sharding:data-source id="shardingDataSource">
> - <!-- Configure sharding rule -->
> - <sharding:sharding-rule data-source-names="ds0,ds1">
> - <sharding:table-rules>
> - <!-- Configure t_order table rule -->
> - <sharding:table-rule logic-table="t_order" actual-data-nodes="ds$->{0..1}.t_order$->{0..1}" database-strategy-ref="dbStrategy" table-strategy-ref="tableStrategy" />
> - <!-- Omit t_order_item table rule configuration ... -->
> - <!-- ... -->
> - </sharding:table-rules>
> - </sharding:sharding-rule>
> - </sharding:data-source>
> + <shardingsphere:data-source id="shardingDataSource" data-source-names="ds0,ds1" rule-refs="shardingRule">
> + <props>
> + <prop key="sql-show">false</prop>
> + </props>
> + </shardingsphere:data-source>
> +
> </beans>
21d146
< ## 配置分片算法