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 117b333 Revise spring namespace (#6490)
117b333 is described below
commit 117b333c1205cc70b3e9f05de57eb0fcb0e76e32
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Jul 28 19:14:02 2020 +0800
Revise spring namespace (#6490)
* Rename ConfigurationListenerManager
* Refactor OrchestrationListenerManager
* Refactor OrchestrationFacade
* Refactor OrchestrationFacade
* For code style
* Revise spring namespace
* fix test case
---
.../spring-namespace/governance.cn.md | 33 +++++++++------
.../spring-namespace/governance.en.md | 35 ++++++++++------
.../usage/governance/spring-namespace.cn.md | 8 ++--
.../usage/governance/spring-namespace.en.md | 8 ++--
.../META-INF/nacos/cloud/application-encrypt.xml | 8 ++--
.../nacos/cloud/application-master-slave.xml | 10 ++---
.../META-INF/nacos/cloud/application-shadow.xml | 8 ++--
.../application-sharding-databases-tables.xml | 10 ++---
.../META-INF/nacos/local/application-encrypt.xml | 10 ++---
.../nacos/local/application-master-slave.xml | 2 +-
.../META-INF/nacos/local/application-shadow.xml | 24 +++++------
.../application-sharding-databases-tables.xml | 28 ++++++-------
.../resources/META-INF/nacos/registry-center.xml | 8 ++--
.../zookeeper/cloud/application-encrypt.xml | 2 +-
.../zookeeper/cloud/application-master-slave.xml | 2 +-
.../zookeeper/cloud/application-shadow.xml | 2 +-
.../application-sharding-databases-tables.xml | 2 +-
.../zookeeper/local/application-encrypt.xml | 2 +-
.../zookeeper/local/application-master-slave.xml | 2 +-
.../zookeeper/local/application-shadow.xml | 6 +--
.../application-sharding-databases-tables.xml | 2 +-
.../META-INF/zookeeper/registry-center.xml | 4 +-
.../pom.xml | 14 +++----
.../orchestration/core/config/ConfigCenter.java | 8 ++--
...ager.java => ConfigurationListenerManager.java} | 6 +--
.../core/config/ConfigCenterTest.java | 4 +-
....java => ConfigurationListenerManagerTest.java} | 4 +-
.../core/facade/OrchestrationFacade.java | 47 +++++++++++-----------
.../listener/OrchestrationListenerManager.java | 10 ++---
.../core/facade/OrchestrationFacadeTest.java | 4 +-
.../OrchestrationListenerManagerTest.java | 20 +++++----
.../core/registry/RegistryCenter.java | 8 ++--
.../constants/DataSourceBeanDefinitionTag.java | 6 ++-
...rationCenterConfigurationBeanDefinitionTag.java | 4 +-
.../handler/OrchestrationNamespaceHandler.java | 3 +-
.../parser/DataSourceBeanDefinitionParser.java | 13 ++----
.../main/resources/META-INF/namespace/cluster.xsd | 8 ++--
.../resources/META-INF/namespace/orchestration.xsd | 16 +++++++-
.../META-INF/rdb/encryptOrchestration.xml | 6 +--
.../META-INF/rdb/masterSlaveOrchestration.xml | 12 +++---
.../rdb/shardingMasterSlaveOrchestration.xml | 8 ++--
.../META-INF/rdb/shardingOrchestration.xml | 22 +++++-----
.../OrchestrationConfigurationConverter.java | 4 +-
43 files changed, 237 insertions(+), 206 deletions(-)
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/governance.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/governance.cn.md
index 00d598a..feaa53d 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/governance.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/governance.cn.md
@@ -18,25 +18,33 @@ weight = 6
http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration.xsd
">
- <orchestration:instance id="regCenter" type="zookeeper"
server-lists="localhost:2181" namespace="orchestration-spring-namespace-demo">
+ <orchestration:reg-center id="regCenter" type="ZooKeeper"
server-lists="localhost:2181">
<props>
<prop key="overwrite">true</prop>
</props>
- </orchestration:instance>
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
instance-ref="regCenter" />
+ </orchestration:reg-center>
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
reg-center-ref="regCenter" />
</beans>
```
命名空间:
[http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration-5.0.0.xsd](http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration-5.0.0.xsd)
-<orchestration:instance />
+<orchestration:reg-center />
-| *名称* | *类型* | *说明*
|
-| ------------- | ------ |
-------------------------------------------------------------------------- |
-| id | 属性 | 治理实例名称
|
-| type | 属性 | 治理实例类型。如:zookeeper, etcd, apollo, nacos
|
-| server-lists | 属性 | 治理服务列表。包括 IP 地址和端口号。多个地址用逗号分隔。如:
host1:2181,host2:2181 |
-| namespace (?) | 属性 | 治理命名空间
|
-| props (?) | 属性 | 配置本实例需要的其他参数,例如 ZooKeeper 的连接参数等
|
+| *名称* | *类型* | *说明*
|
+| ------------- | ------ |
----------------------------------------------------------------------------- |
+| id | 属性 | 注册中心实例名称
|
+| type | 属性 | 注册中心类型。如:ZooKeeper, etcd
|
+| server-lists | 属性 | 注册中心服务列表。包括 IP 地址和端口号。多个地址用逗号分隔。如:
host1:2181,host2:2181 |
+| props (?) | 属性 | 配置本实例需要的其他参数,例如 ZooKeeper 的连接参数等
|
+
+<orchestration:config-center />
+
+| *名称* | *类型* | *说明*
|
+| ------------- | ------ |
----------------------------------------------------------------------------- |
+| id | 属性 | 配置中心实例名称
|
+| type | 属性 | 配置中心类型。如:ZooKeeper, etcd, Apollo, Nacos
|
+| server-lists | 属性 | 配置中心服务列表。包括 IP 地址和端口号。多个地址用逗号分隔。如:
host1:2181,host2:2181 |
+| props (?) | 属性 | 配置本实例需要的其他参数,例如 ZooKeeper 的连接参数等
|
### 集群管理
@@ -54,10 +62,11 @@ weight = 6
http://shardingsphere.apache.org/schema/shardingsphere/cluster/cluster.xsd
">
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
instance-ref="regCenter" cluster-ref="cluster" />
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
reg-center-ref="regCenter" cluster-ref="cluster" />
<cluster:heartbeat id="cluster" sql="select 1" threadCount="1"
interval="60" retryEnable="false" retryMaximum="3" retryInterval="3"/>
</beans>
```
+
命名空间:
[http://shardingsphere.apache.org/schema/shardingsphere/orchestration/cluster-5.0.0.xsd](http://shardingsphere.apache.org/schema/shardingsphere/orchestration/cluster-5.0.0.xsd)
<cluster:heartbeat />
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/governance.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/governance.en.md
index 122b62c..1a6360e 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/governance.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/governance.en.md
@@ -17,25 +17,35 @@ weight = 6
http://shardingsphere.apache.org/schema/shardingsphere/orchestration
http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration.xsd
">
- <orchestration:instance id="regCenter" type="zookeeper"
server-lists="localhost:2181" namespace="orchestration-spring-namespace-demo">
+ <orchestration:reg-center id="regCenter" type="zookeeper"
server-lists="localhost:2181">
<props>
<prop key="overwrite">true</prop>
</props>
- </orchestration:instance>
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
instance-ref="regCenter" />
+ </orchestration:reg-center>
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
reg-center-ref="regCenter" />
</beans>
```
+
Namespace:
[http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration-5.0.0.xsd](http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration-5.0.0.xsd)
-<orchestration:instance />
+<orchestration:reg-center />
+
+| *Name* | *Type* | *Description*
|
+| ------------- | ---------- |
---------------------------------------------------------------------------------------------------------
|
+| id | Attribute | Registry center name
|
+| type | Attribute | Registry center type. Example: ZooKeeper, etcd
|
+| server-lists | Attribute | The list of servers that connect to registry
center, including IP and port number; use commas to separate |
+| props (?) | Attribute | Properties for center instance config, such as
options of zookeeper |
+
+<orchestration:config-center />
+
+| *Name* | *Type* | *Description*
|
+| ------------- | ---------- |
-------------------------------------------------------------------------------------------------------
|
+| id | Attribute | Config center name
|
+| type | Attribute | Config center type. Example: ZooKeeper, etcd,
Nacos, Apollo |
+| server-lists | Attribute | The list of servers that connect to config
center, including IP and port number; use commas to separate |
+| props (?) | Attribute | Properties for center instance config, such as
options of zookeeper |
-| *Name* | *Type* | *Description*
|
-| ------------- | ---------- |
----------------------------------------------------------------------------------------------------------------
|
-| id | Attribute | Orchestration instance name
|
-| type | Attribute | Orchestration instance type. Example:zookeeper,
etcd, apollo, nacos |
-| server-lists | Attribute | The list of servers that connect to
orchestration instance, including IP and port number; use commas to separate |
-| namespace (?) | Attribute | Orchestration namespace
|
-| props (?) | Attribute | Properties for center instance config, such as
options of zookeeper |
### Cluster
```xml
@@ -52,10 +62,11 @@ Namespace:
[http://shardingsphere.apache.org/schema/shardingsphere/orchestration
http://shardingsphere.apache.org/schema/shardingsphere/cluster/cluster.xsd
">
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
instance-ref="regCenter" cluster-ref="cluster" />
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
reg-center-ref="regCenter" cluster-ref="cluster" />
<cluster:heartbeat id="cluster" sql="select 1" threadCount="1"
interval="60" retryEnable="false" retryMaximum="3" retryInterval="3"/>
</beans>
```
+
Namespace:
[http://shardingsphere.apache.org/schema/shardingsphere/orchestration/cluster-5.0.0.xsd](http://shardingsphere.apache.org/schema/shardingsphere/orchestration/cluster-5.0.0.xsd)
<cluster:heartbeat />
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace.cn.md
index 11d623a..656bb1b 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace.cn.md
@@ -42,10 +42,10 @@ weight = 4
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">3000</prop>
</util:properties>
- <orchestration:instance id="regCenter" type="zookeeper"
server-lists="localhost:2181" namespace="orchestration-spring-namespace-demo"
properties-ref="instance-properties" />
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
instance-ref="regCenter" overwrite="true" />
- <orchestration:slave-data-source id="masterSlaveDataSource"
data-source-ref="realMasterSlaveDataSource" instance-ref="regCenter"
overwrite="true" />
- <orchestration:data-source id="encryptDataSource"
data-source-ref="realEncryptDataSource" instance-ref="regCenter"
overwrite="true" />
+ <orchestration:reg-center id="regCenter" type="zookeeper"
server-lists="localhost:2181" />
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
reg-center-ref="regCenter" overwrite="true" />
+ <orchestration:slave-data-source id="masterSlaveDataSource"
data-source-ref="realMasterSlaveDataSource" reg-center-ref="regCenter"
overwrite="true" />
+ <orchestration:data-source id="encryptDataSource"
data-source-ref="realEncryptDataSource" reg-center-ref="regCenter"
overwrite="true" />
</beans>
```
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace.en.md
index 19f4d8a..c2f1c9f 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/usage/governance/spring-namespace.en.md
@@ -42,10 +42,10 @@ weight = 4
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">3000</prop>
</util:properties>
- <orchestration:instance id="regCenter" type="zookeeper"
server-lists="localhost:2181" namespace="orchestration-spring-namespace-demo"
properties-ref="instance-properties" />
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
instance-ref="regCenter" overwrite="true" />
- <orchestration:slave-data-source id="masterSlaveDataSource"
data-source-ref="realMasterSlaveDataSource" instance-ref="regCenter"
overwrite="true" />
- <orchestration:data-source id="encryptDataSource"
data-source-ref="realEncryptDataSource" instance-ref="regCenter"
overwrite="true" />
+ <orchestration:reg-center id="regCenter" type="zookeeper"
server-lists="localhost:2181" />
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
reg-center-ref="regCenter" overwrite="true" />
+ <orchestration:slave-data-source id="masterSlaveDataSource"
data-source-ref="realMasterSlaveDataSource" reg-center-ref="regCenter"
overwrite="true" />
+ <orchestration:data-source id="encryptDataSource"
data-source-ref="realEncryptDataSource" reg-center-ref="regCenter"
overwrite="true" />
</beans>
```
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-encrypt.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-encrypt.xml
index a86d31b..8b1cca2 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-encrypt.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-encrypt.xml
@@ -33,7 +33,7 @@
<context:component-scan
base-package="org.apache.shardingsphere.example.core.mybatis" />
- <orchestration:data-source id="encryptDataSource"
instance-ref="regCenter,confCenter" />
+ <orchestration:data-source id="encryptDataSource"
reg-center-ref="regCenter" config-center-ref="confCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="encryptDataSource" />
@@ -42,11 +42,11 @@
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="encryptDataSource"/>
- <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml"/>
+ <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
+ <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository" />
+ <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
</beans>
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-master-slave.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-master-slave.xml
index 2de9dfe..88ee8ce 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-master-slave.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-master-slave.xml
@@ -31,19 +31,19 @@
http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration.xsd">
<import resource="classpath*:META-INF/nacos/registry-center.xml" />
<context:component-scan
base-package="org.apache.shardingsphere.example.core.mybatis" />
-
- <orchestration:data-source id="masterSlaveDataSource"
instance-ref="regCenter,confCenter" />
-
+
+ <orchestration:data-source id="masterSlaveDataSource"
reg-center-ref="regCenter" config-center-ref="confCenter" />
+
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="masterSlaveDataSource" />
</bean>
<tx:annotation-driven />
-
+
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="masterSlaveDataSource"/>
<property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml"/>
</bean>
-
+
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-shadow.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-shadow.xml
index 8e9a647..5e154af 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-shadow.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-shadow.xml
@@ -33,7 +33,7 @@
<context:component-scan
base-package="org.apache.shardingsphere.example.core.mybatis" />
- <orchestration:data-source id="shadowDataSource"
instance-ref="regCenter,confCenter" />
+ <orchestration:data-source id="shadowDataSource"
reg-center-ref="regCenter" config-center-ref="confCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="shadowDataSource" />
@@ -42,11 +42,11 @@
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="shadowDataSource"/>
- <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml"/>
+ <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
+ <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository" />
+ <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
</beans>
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-sharding-databases-tables.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-sharding-databases-tables.xml
index 21da0a5..02c405a 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-sharding-databases-tables.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/cloud/application-sharding-databases-tables.xml
@@ -32,7 +32,7 @@
<import resource="classpath*:META-INF/nacos/registry-center.xml" />
<context:component-scan
base-package="org.apache.shardingsphere.example.core.mybatis" />
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
instance-ref="regCenter,confCenter" />
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
reg-center-ref="regCenter" config-center-ref="confCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="shardingDatabasesTablesDataSource" />
@@ -40,12 +40,12 @@
<tx:annotation-driven />
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="shardingDatabasesTablesDataSource"/>
- <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml"/>
+ <property name="dataSource" ref="shardingDatabasesTablesDataSource" />
+ <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
+ <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository" />
+ <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
</beans>
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-encrypt.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-encrypt.xml
index f6cf50a..392eb09 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-encrypt.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-encrypt.xml
@@ -66,7 +66,7 @@
</props>
</shardingsphere:data-source>
- <orchestration:data-source id="encryptDataSource"
data-source-ref="realEncryptDataSource" instance-ref="regCenter,confCenter" />
+ <orchestration:data-source id="encryptDataSource"
data-source-ref="realEncryptDataSource" reg-center-ref="regCenter"
config-center-ref="confCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="encryptDataSource" />
@@ -74,12 +74,12 @@
<tx:annotation-driven />
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="encryptDataSource"/>
- <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml"/>
+ <property name="dataSource" ref="encryptDataSource" />
+ <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
+ <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository" />
+ <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
</beans>
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-master-slave.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-master-slave.xml
index aea04a6..73eb07c 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-master-slave.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-master-slave.xml
@@ -68,7 +68,7 @@
<shardingsphere:data-source id="realMasterSlaveDataSource"
data-source-names="demo_ds_master, demo_ds_slave_0, demo_ds_slave_1"
rule-refs="masterSlaveRule" />
- <orchestration:data-source id="masterSlaveDataSource"
data-source-ref="realMasterSlaveDataSource" instance-ref="regCenter,confCenter"
/>
+ <orchestration:data-source id="masterSlaveDataSource"
data-source-ref="realMasterSlaveDataSource" reg-center-ref="regCenter"
config-center-ref="confCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="masterSlaveDataSource" />
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-shadow.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-shadow.xml
index 85b02a2..f383a6a 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-shadow.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-shadow.xml
@@ -41,27 +41,27 @@
<bean id="shadow_demo_ds" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl"
value="jdbc:mysql://localhost:3306/shadow_demo_ds"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
+ <property name="jdbcUrl"
value="jdbc:mysql://localhost:3306/shadow_demo_ds" />
+ <property name="username" value="root" />
+ <property name="password" value="" />
</bean>
<bean id="demo_ds" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="close">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_ds"/>
- <property name="username" value="root"/>
+ <property name="driverClassName" value="com.mysql.jdbc.Driver" />
+ <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_ds" />
+ <property name="username" value="root" />
<property name="password" value=""/>
</bean>
<shadow:rule id="shadowRule" column="shadow">
<shadow:mappings>
- <shadow:mapping product-data-source-name="demo_ds"
shadow-data-source-name="shadow_demo_ds"/>
+ <shadow:mapping product-data-source-name="demo_ds"
shadow-data-source-name="shadow_demo_ds" />
</shadow:mappings>
</shadow:rule>
<shardingsphere:data-source id="realShadowDataSource"
data-source-names="demo_ds,shadow_demo_ds" rule-refs="shadowRule" />
-
- <orchestration:data-source id="shadowDataSource"
data-source-ref="realShadowDataSource" instance-ref="regCenter,confCenter" />
+
+ <orchestration:data-source id="shadowDataSource"
data-source-ref="realShadowDataSource" reg-center-ref="regCenter"
config-center-ref="confCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="shadowDataSource" />
@@ -70,11 +70,11 @@
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="shadowDataSource"/>
- <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml"/>
+ <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
+ <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository" />
+ <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
</beans>
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-sharding-databases-tables.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-sharding-databases-tables.xml
index 5fd38e5..fd7f663 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-sharding-databases-tables.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/local/application-sharding-databases-tables.xml
@@ -41,16 +41,16 @@
<context:component-scan
base-package="org.apache.shardingsphere.example.core.mybatis" />
<bean id="demo_ds_0" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl"
value="jdbc:mysql://localhost:3306/demo_ds_0?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
+ <property name="jdbcUrl"
value="jdbc:mysql://localhost:3306/demo_ds_0?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC"
/>
+ <property name="username" value="root" />
+ <property name="password" value="" />
</bean>
<bean id="demo_ds_1" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
- <property name="jdbcUrl"
value="jdbc:mysql://localhost:3306/demo_ds_1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
+ <property name="jdbcUrl"
value="jdbc:mysql://localhost:3306/demo_ds_1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC"
/>
+ <property name="username" value="root" />
+ <property name="password" value="" />
</bean>
<sharding:sharding-algorithm id="databaseInlineStrategyShardingAlgorithm"
type="INLINE">
@@ -81,22 +81,22 @@
<sharding:key-generate-strategy id="orderKeyGenerator" column="order_id"
algorithm-ref="snowflakeAlgorithm" />
<sharding:key-generate-strategy id="itemKeyGenerator"
column="order_item_id" algorithm-ref="snowflakeAlgorithm" />
-
+
<sharding:rule id="shardingRule">
<sharding:table-rules>
<sharding:table-rule logic-table="t_order"
actual-data-nodes="demo_ds_${0..1}.t_order_${0..1}"
database-strategy-ref="databaseStrategy"
table-strategy-ref="orderTableStrategy"
key-generate-strategy-ref="orderKeyGenerator" />
<sharding:table-rule logic-table="t_order_item"
actual-data-nodes="demo_ds_${0..1}.t_order_item_${0..1}"
database-strategy-ref="databaseStrategy"
table-strategy-ref="orderItemTableStrategy"
key-generate-strategy-ref="itemKeyGenerator" />
</sharding:table-rules>
<sharding:binding-table-rules>
- <sharding:binding-table-rule logic-tables="t_order, t_order_item"/>
+ <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-rule table="t_address" />
</sharding:broadcast-table-rules>
</sharding:rule>
<shardingsphere:data-source id="realShardingDatabasesTablesDataSource"
data-source-names="demo_ds_0, demo_ds_1" rule-refs="shardingRule" />
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
instance-ref="regCenter,confCenter" />
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
reg-center-ref="regCenter" config-center-ref="confCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="shardingDatabasesTablesDataSource" />
@@ -104,12 +104,12 @@
<tx:annotation-driven />
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
- <property name="dataSource" ref="shardingDatabasesTablesDataSource"/>
- <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml"/>
+ <property name="dataSource" ref="shardingDatabasesTablesDataSource" />
+ <property name="mapperLocations"
value="classpath*:META-INF/mappers/*.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
- <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository"/>
- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
+ <property name="basePackage"
value="org.apache.shardingsphere.example.core.mybatis.repository" />
+ <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
</beans>
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/registry-center.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/registry-center.xml
index 0a13524..d461412 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/registry-center.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/nacos/registry-center.xml
@@ -24,17 +24,17 @@
http://shardingsphere.apache.org/schema/shardingsphere/orchestration
http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration.xsd
">
- <orchestration:instance id="confCenter" type="Nacos"
server-lists="localhost:8848">
+ <orchestration:reg-center id="confCenter" type="Nacos"
server-lists="localhost:8848">
<props>
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">3000</prop>
</props>
- </orchestration:instance>
+ </orchestration:reg-center>
- <orchestration:instance id="regCenter" type="ZooKeeper"
server-lists="localhost:2181">
+ <orchestration:reg-center id="regCenter" type="ZooKeeper"
server-lists="localhost:2181">
<props>
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">3000</prop>
</props>
- </orchestration:instance>
+ </orchestration:reg-center>
</beans>
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-encrypt.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-encrypt.xml
index 1a0fa0c..77c9a73 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-encrypt.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-encrypt.xml
@@ -33,7 +33,7 @@
<context:component-scan
base-package="org.apache.shardingsphere.example.core.mybatis" />
- <orchestration:data-source id="encryptDataSource" instance-ref="regCenter"
/>
+ <orchestration:data-source id="encryptDataSource"
reg-center-ref="regCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="encryptDataSource" />
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-master-slave.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-master-slave.xml
index 473c97f..0140493 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-master-slave.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-master-slave.xml
@@ -32,7 +32,7 @@
<context:component-scan
base-package="org.apache.shardingsphere.example.core.mybatis" />
<import resource="classpath*:META-INF/zookeeper/registry-center.xml" />
- <orchestration:data-source id="masterSlaveDataSource"
instance-ref="regCenter" />
+ <orchestration:data-source id="masterSlaveDataSource"
reg-center-ref="regCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="masterSlaveDataSource" />
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-shadow.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-shadow.xml
index 0e35946..a00d923 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-shadow.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-shadow.xml
@@ -33,7 +33,7 @@
<context:component-scan
base-package="org.apache.shardingsphere.example.core.mybatis" />
- <orchestration:data-source id="shadowDataSource" instance-ref="regCenter"
/>
+ <orchestration:data-source id="shadowDataSource"
reg-center-ref="regCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="shadowDataSource" />
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-sharding-databases-tables.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-sharding-databases-tables.xml
index bffb939..3839237 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-sharding-databases-tables.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/cloud/application-sharding-databases-tables.xml
@@ -32,7 +32,7 @@
<import resource="classpath*:META-INF/zookeeper/registry-center.xml" />
<context:component-scan
base-package="org.apache.shardingsphere.example.core.mybatis" />
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
instance-ref="regCenter" />
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
reg-center-ref="regCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="shardingDatabasesTablesDataSource" />
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-encrypt.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-encrypt.xml
index cc1fa39..7bf5ca7 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-encrypt.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-encrypt.xml
@@ -66,7 +66,7 @@
</props>
</shardingsphere:data-source>
- <orchestration:data-source id="encryptDataSource"
data-source-ref="realEncryptDataSource" instance-ref="regCenter" />
+ <orchestration:data-source id="encryptDataSource"
data-source-ref="realEncryptDataSource" reg-center-ref="regCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="encryptDataSource" />
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-master-slave.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-master-slave.xml
index bd0ccfb..f98df20 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-master-slave.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-master-slave.xml
@@ -68,7 +68,7 @@
<shardingsphere:data-source id="realMasterSlaveDataSource"
data-source-names="demo_ds_master, demo_ds_slave_0, demo_ds_slave_1"
rule-refs="masterSlaveRule" />
- <orchestration:data-source id="masterSlaveDataSource"
data-source-ref="realMasterSlaveDataSource" instance-ref="regCenter" />
+ <orchestration:data-source id="masterSlaveDataSource"
data-source-ref="realMasterSlaveDataSource" reg-center-ref="regCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="masterSlaveDataSource" />
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-shadow.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-shadow.xml
index 62e0f73..6c6a8e9 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-shadow.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-shadow.xml
@@ -45,7 +45,7 @@
<property name="username" value="root"/>
<property name="password" value=""/>
</bean>
-
+
<bean id="demo_ds" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/demo_ds"/>
@@ -60,8 +60,8 @@
</shadow:rule>
<shardingsphere:data-source id="realShadowDataSource"
data-source-names="demo_ds,shadow_demo_ds" rule-refs="shadowRule" />
-
- <orchestration:data-source id="shadowDataSource"
data-source-ref="realShadowDataSource" instance-ref="regCenter" />
+
+ <orchestration:data-source id="shadowDataSource"
data-source-ref="realShadowDataSource" reg-center-ref="regCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="shadowDataSource" />
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-sharding-databases-tables.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-sharding-databases-tables.xml
index e47aa76..cf87915 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-sharding-databases-tables.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/local/application-sharding-databases-tables.xml
@@ -99,7 +99,7 @@
</sharding:rule>
<shardingsphere:data-source id="realShardingDatabasesTablesDataSource"
data-source-names="demo_ds_0, demo_ds_1" rule-refs="shardingRule" />
- <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
instance-ref="regCenter" />
+ <orchestration:data-source id="shardingDatabasesTablesDataSource"
data-source-ref="realShardingDatabasesTablesDataSource"
reg-center-ref="regCenter" />
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="shardingDatabasesTablesDataSource" />
diff --git
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/registry-center.xml
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/registry-center.xml
index 54a94a3..13a43e0 100644
---
a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/registry-center.xml
+++
b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-spring-namespace-example/src/main/resources/META-INF/zookeeper/registry-center.xml
@@ -24,10 +24,10 @@
http://shardingsphere.apache.org/schema/shardingsphere/orchestration
http://shardingsphere.apache.org/schema/shardingsphere/orchestration/orchestration.xsd
">
- <orchestration:instance id="regCenter" type="ZooKeeper"
server-lists="localhost:2181">
+ <orchestration:reg-center id="regCenter" type="ZooKeeper"
server-lists="localhost:2181">
<props>
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">3000</prop>
</props>
- </orchestration:instance>
+ </orchestration:reg-center>
</beans>
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/pom.xml
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/pom.xml
index d513838..cab7321 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/pom.xml
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-common/pom.xml
@@ -29,37 +29,37 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-sharding-common</artifactId>
+
<artifactId>shardingsphere-orchestration-repository-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-common</artifactId>
+ <artifactId>shardingsphere-metrics-configuration</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-encrypt-common</artifactId>
+ <artifactId>shardingsphere-cluster-configuration</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-shadow-common</artifactId>
+ <artifactId>shardingsphere-sharding-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
-
<artifactId>shardingsphere-orchestration-repository-api</artifactId>
+ <artifactId>shardingsphere-master-slave-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-metrics-configuration</artifactId>
+ <artifactId>shardingsphere-encrypt-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-cluster-configuration</artifactId>
+ <artifactId>shardingsphere-shadow-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenter.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenter.java
index 1dad9b2..7113cc4 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenter.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenter.java
@@ -285,13 +285,13 @@ public final class ConfigCenter {
}
/**
- * Get all sharding schema names.
+ * Get all schema names.
*
* @return all sharding schema names
*/
- public Collection<String> getAllShardingSchemaNames() {
- String shardingSchemaNames = repository.get(node.getSchemaPath());
- return Strings.isNullOrEmpty(shardingSchemaNames) ? new LinkedList<>()
: node.splitShardingSchemaName(shardingSchemaNames);
+ public Collection<String> getAllSchemaNames() {
+ String schemaNames = repository.get(node.getSchemaPath());
+ return Strings.isNullOrEmpty(schemaNames) ? new LinkedList<>() :
node.splitShardingSchemaName(schemaNames);
}
/**
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationChangedListenerManager.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationListener
[...]
similarity index 90%
rename from
shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationChangedListenerManager.java
rename to
shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationListenerManager.java
index 7fbb359..22e5781 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationChangedListenerManager.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationListenerManager.java
@@ -23,9 +23,9 @@ import
org.apache.shardingsphere.orchestration.repository.api.listener.DataChang
import java.util.Collection;
/**
- * Configuration changed listener manager.
+ * Configuration listener manager.
*/
-public final class ConfigurationChangedListenerManager {
+public final class ConfigurationListenerManager {
private final SchemaChangedListener schemaChangedListener;
@@ -37,7 +37,7 @@ public final class ConfigurationChangedListenerManager {
private final ClusterConfigurationChangedListener
clusterConfigurationChangedListener;
- public ConfigurationChangedListenerManager(final String name, final
ConfigurationRepository configurationRepository, final Collection<String>
shardingSchemaNames) {
+ public ConfigurationListenerManager(final String name, final
ConfigurationRepository configurationRepository, final Collection<String>
shardingSchemaNames) {
schemaChangedListener = new SchemaChangedListener(name,
configurationRepository, shardingSchemaNames);
propertiesChangedListener = new PropertiesChangedListener(name,
configurationRepository);
authenticationChangedListener = new
AuthenticationChangedListener(name, configurationRepository);
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenterTest.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenterTest.java
index 12efe4f..50b18d7 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenterTest.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenterTest.java
@@ -528,10 +528,10 @@ public final class ConfigCenterTest {
}
@Test
- public void assertGetAllShardingSchemaNames() {
+ public void assertGetAllSchemaNames() {
when(configurationRepository.get("/test/config/schema")).thenReturn("sharding_db,masterslave_db");
ConfigCenter configurationService = new ConfigCenter("test",
configurationRepository);
- Collection<String> actual =
configurationService.getAllShardingSchemaNames();
+ Collection<String> actual = configurationService.getAllSchemaNames();
assertThat(actual.size(), is(2));
assertThat(actual, hasItems("sharding_db"));
assertThat(actual, hasItems("masterslave_db"));
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationChangedListenerManagerTest.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationList
[...]
similarity index 91%
rename from
shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationChangedListenerManagerTest.java
rename to
shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationListenerManagerTest.java
index 4d74800..2328772 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationChangedListenerManagerTest.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/test/java/org/apache/shardingsphere/orchestration/core/config/listener/ConfigurationListenerManagerTest.java
@@ -31,7 +31,7 @@ import java.util.Arrays;
import static org.mockito.Mockito.verify;
@RunWith(MockitoJUnitRunner.class)
-public final class ConfigurationChangedListenerManagerTest {
+public final class ConfigurationListenerManagerTest {
@Mock
private ConfigurationRepository configurationRepository;
@@ -47,7 +47,7 @@ public final class ConfigurationChangedListenerManagerTest {
@Test
public void assertInitListeners() {
- ConfigurationChangedListenerManager actual = new
ConfigurationChangedListenerManager("test", configurationRepository,
Arrays.asList("sharding_db", "masterslave_db"));
+ ConfigurationListenerManager actual = new
ConfigurationListenerManager("test", configurationRepository,
Arrays.asList("sharding_db", "masterslave_db"));
setField(actual, "schemaChangedListener", schemaChangedListener);
setField(actual, "propertiesChangedListener",
propertiesChangedListener);
setField(actual, "authenticationChangedListener",
authenticationChangedListener);
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/main/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationFacade.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/main/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationFacade.java
index a6bef3d..a9cdb8e 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/main/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationFacade.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/main/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationFacade.java
@@ -49,8 +49,8 @@ public final class OrchestrationFacade implements
AutoCloseable {
static {
// TODO avoid multiple loading
- ShardingSphereServiceLoader.register(ConfigurationRepository.class);
ShardingSphereServiceLoader.register(RegistryRepository.class);
+ ShardingSphereServiceLoader.register(ConfigurationRepository.class);
}
private RegistryRepository registryRepository;
@@ -73,40 +73,39 @@ public final class OrchestrationFacade implements
AutoCloseable {
/**
* Initialize orchestration facade.
*
- * @param orchestrationConfig orchestration configuration
- * @param shardingSchemaNames sharding schema names
+ * @param config orchestration configuration
+ * @param schemaNames schema names
*/
- public void init(final OrchestrationConfiguration orchestrationConfig,
final Collection<String> shardingSchemaNames) {
- isOverwrite = orchestrationConfig.isOverwrite();
- initRegistryCenter(orchestrationConfig);
- initConfigCenter(orchestrationConfig);
- initMetaDataCenter(orchestrationConfig);
- initListenerManager(orchestrationConfig, shardingSchemaNames);
+ public void init(final OrchestrationConfiguration config, final
Collection<String> schemaNames) {
+ isOverwrite = config.isOverwrite();
+ initRegistryCenter(config);
+ initConfigCenter(config);
+ initMetaDataCenter(config);
+ initListenerManager(config, schemaNames);
}
- private void initRegistryCenter(final OrchestrationConfiguration
orchestrationConfig) {
- OrchestrationCenterConfiguration registryCenterConfig =
orchestrationConfig.getRegistryCenterConfiguration();
+ private void initRegistryCenter(final OrchestrationConfiguration config) {
+ OrchestrationCenterConfiguration registryCenterConfig =
config.getRegistryCenterConfiguration();
Preconditions.checkNotNull(registryCenterConfig, "Registry center
configuration cannot be null.");
registryRepository =
TypedSPIRegistry.getRegisteredService(RegistryRepository.class,
registryCenterConfig.getType(), registryCenterConfig.getProps());
- registryRepository.init(orchestrationConfig.getNamespace(),
registryCenterConfig);
- registryCenter = new
RegistryCenter(orchestrationConfig.getNamespace(), registryRepository);
+ registryRepository.init(config.getNamespace(), registryCenterConfig);
+ registryCenter = new RegistryCenter(config.getNamespace(),
registryRepository);
}
- private void initConfigCenter(final OrchestrationConfiguration
orchestrationConfig) {
- OrchestrationCenterConfiguration additionalConfigCenterConfig =
orchestrationConfig.getAdditionalConfigCenterConfiguration().orElse(orchestrationConfig.getRegistryCenterConfiguration());
+ private void initConfigCenter(final OrchestrationConfiguration config) {
+ OrchestrationCenterConfiguration additionalConfigCenterConfig =
config.getAdditionalConfigCenterConfiguration().orElse(config.getRegistryCenterConfiguration());
Preconditions.checkNotNull(additionalConfigCenterConfig, "Config
center configuration cannot be null.");
configurationRepository =
TypedSPIRegistry.getRegisteredService(ConfigurationRepository.class,
additionalConfigCenterConfig.getType(),
additionalConfigCenterConfig.getProps());
- configurationRepository.init(orchestrationConfig.getNamespace(),
additionalConfigCenterConfig);
- configCenter = new ConfigCenter(orchestrationConfig.getNamespace(),
configurationRepository);
+ configurationRepository.init(config.getNamespace(),
additionalConfigCenterConfig);
+ configCenter = new ConfigCenter(config.getNamespace(),
configurationRepository);
}
- private void initMetaDataCenter(final OrchestrationConfiguration
orchestrationConfig) {
- metaDataCenter = new
MetaDataCenter(orchestrationConfig.getNamespace(), configurationRepository);
+ private void initMetaDataCenter(final OrchestrationConfiguration config) {
+ metaDataCenter = new MetaDataCenter(config.getNamespace(),
configurationRepository);
}
- private void initListenerManager(final OrchestrationConfiguration
orchestrationConfig, final Collection<String> shardingSchemaNames) {
- listenerManager = new OrchestrationListenerManager(
- orchestrationConfig.getNamespace(), registryRepository,
configurationRepository, shardingSchemaNames.isEmpty() ?
configCenter.getAllShardingSchemaNames() : shardingSchemaNames);
+ private void initListenerManager(final OrchestrationConfiguration config,
final Collection<String> schemaNames) {
+ listenerManager = new
OrchestrationListenerManager(config.getNamespace(), registryRepository,
configurationRepository, schemaNames.isEmpty() ?
configCenter.getAllSchemaNames() : schemaNames);
}
/**
@@ -132,7 +131,7 @@ public final class OrchestrationFacade implements
AutoCloseable {
public void initConfigurations() {
registryCenter.persistInstanceOnline();
registryCenter.persistDataSourcesNode();
- listenerManager.initListeners();
+ listenerManager.init();
}
/**
@@ -156,8 +155,8 @@ public final class OrchestrationFacade implements
AutoCloseable {
@Override
public void close() {
try {
- configurationRepository.close();
registryRepository.close();
+ configurationRepository.close();
// CHECKSTYLE:OFF
} catch (final Exception ex) {
// CHECKSTYLE:ON
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/main/java/org/apache/shardingsphere/orchestration/core/facade/listener/OrchestrationListenerManager.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/main/java/org/apache/shardingsphere/orchestration/core/facade/listener/OrchestrationListenerManager.java
index 0cc9d3f..f46fbad 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/main/java/org/apache/shardingsphere/orchestration/core/facade/listener/OrchestrationListenerManager.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/main/java/org/apache/shardingsphere/orchestration/core/facade/listener/OrchestrationListenerManager.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.orchestration.core.facade.listener;
-import
org.apache.shardingsphere.orchestration.core.config.listener.ConfigurationChangedListenerManager;
+import
org.apache.shardingsphere.orchestration.core.config.listener.ConfigurationListenerManager;
import
org.apache.shardingsphere.orchestration.core.metadata.listener.MetaDataListenerManager;
import
org.apache.shardingsphere.orchestration.core.registry.listener.RegistryListenerManager;
import
org.apache.shardingsphere.orchestration.repository.api.ConfigurationRepository;
@@ -30,7 +30,7 @@ import java.util.Collection;
*/
public final class OrchestrationListenerManager {
- private final ConfigurationChangedListenerManager
configurationChangedListenerManager;
+ private final ConfigurationListenerManager configurationListenerManager;
private final RegistryListenerManager registryListenerManager;
@@ -38,7 +38,7 @@ public final class OrchestrationListenerManager {
public OrchestrationListenerManager(final String name,
final RegistryRepository
registryRepository, final ConfigurationRepository configurationRepository,
final Collection<String> shardingSchemaNames) {
- configurationChangedListenerManager = new
ConfigurationChangedListenerManager(name, configurationRepository,
shardingSchemaNames);
+ configurationListenerManager = new ConfigurationListenerManager(name,
configurationRepository, shardingSchemaNames);
registryListenerManager = new RegistryListenerManager(name,
registryRepository);
metaDataListenerManager = new MetaDataListenerManager(name,
configurationRepository, shardingSchemaNames);
}
@@ -46,8 +46,8 @@ public final class OrchestrationListenerManager {
/**
* Initialize all orchestration listeners.
*/
- public void initListeners() {
- configurationChangedListenerManager.initListeners();
+ public void init() {
+ configurationListenerManager.initListeners();
registryListenerManager.initListeners();
metaDataListenerManager.initListeners();
}
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationFacadeTest.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationFacadeTest.java
index 18e09cb..db490a1 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationFacadeTest.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationFacadeTest.java
@@ -92,7 +92,7 @@ public final class OrchestrationFacadeTest {
verify(configCenter).persistGlobalConfiguration(authentication, props,
false);
verify(registryCenter).persistInstanceOnline();
verify(registryCenter).persistDataSourcesNode();
- verify(listenerManager).initListeners();
+ verify(listenerManager).init();
}
@Test
@@ -107,7 +107,7 @@ public final class OrchestrationFacadeTest {
orchestrationFacade.initConfigurations();
verify(registryCenter).persistInstanceOnline();
verify(registryCenter).persistDataSourcesNode();
- verify(listenerManager).initListeners();
+ verify(listenerManager).init();
}
@Test
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationListenerManagerTest.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/listener/OrchestrationListenerManagerTest.java
similarity index 81%
rename from
shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationListenerManagerTest.java
rename to
shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/listener/OrchestrationListenerManagerTest.java
index abd390c..35cccc8 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/OrchestrationListenerManagerTest.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-facade/src/test/java/org/apache/shardingsphere/orchestration/core/facade/listener/OrchestrationListenerManagerTest.java
@@ -15,16 +15,14 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.orchestration.core.facade;
+package org.apache.shardingsphere.orchestration.core.facade.listener;
+import
org.apache.shardingsphere.orchestration.core.config.listener.ConfigurationListenerManager;
+import org.apache.shardingsphere.orchestration.core.facade.util.FieldUtil;
import
org.apache.shardingsphere.orchestration.core.metadata.listener.MetaDataListenerManager;
+import
org.apache.shardingsphere.orchestration.core.registry.listener.RegistryListenerManager;
import
org.apache.shardingsphere.orchestration.repository.api.ConfigurationRepository;
import
org.apache.shardingsphere.orchestration.repository.api.RegistryRepository;
-
-import
org.apache.shardingsphere.orchestration.core.config.listener.ConfigurationChangedListenerManager;
-import
org.apache.shardingsphere.orchestration.core.facade.listener.OrchestrationListenerManager;
-import org.apache.shardingsphere.orchestration.core.facade.util.FieldUtil;
-import
org.apache.shardingsphere.orchestration.core.registry.listener.RegistryListenerManager;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -44,7 +42,7 @@ public final class OrchestrationListenerManagerTest {
private ConfigurationRepository configurationRepository;
@Mock
- private ConfigurationChangedListenerManager
configurationChangedListenerManager;
+ private ConfigurationListenerManager configurationListenerManager;
@Mock
private MetaDataListenerManager metaDataListenerManager;
@@ -53,13 +51,13 @@ public final class OrchestrationListenerManagerTest {
private RegistryListenerManager registryListenerManager;
@Test
- public void assertInitListeners() {
+ public void assertInit() {
OrchestrationListenerManager actual = new
OrchestrationListenerManager("test_name", registryRepository,
configurationRepository, Collections.emptyList());
- FieldUtil.setField(actual, "configurationChangedListenerManager",
configurationChangedListenerManager);
+ FieldUtil.setField(actual, "configurationListenerManager",
configurationListenerManager);
FieldUtil.setField(actual, "registryListenerManager",
registryListenerManager);
FieldUtil.setField(actual, "metaDataListenerManager",
metaDataListenerManager);
- actual.initListeners();
- verify(configurationChangedListenerManager).initListeners();
+ actual.init();
+ verify(configurationListenerManager).initListeners();
verify(registryListenerManager).initListeners();
verify(metaDataListenerManager).initListeners();
}
diff --git
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-registry/src/main/java/org/apache/shardingsphere/orchestration/core/registry/RegistryCenter.java
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-registry/src/main/java/org/apache/shardingsphere/orchestration/core/registry/RegistryCenter.java
index df70ccd..b875ecc 100644
---
a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-registry/src/main/java/org/apache/shardingsphere/orchestration/core/registry/RegistryCenter.java
+++
b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-registry/src/main/java/org/apache/shardingsphere/orchestration/core/registry/RegistryCenter.java
@@ -25,7 +25,7 @@ import java.util.Collection;
import java.util.stream.Collectors;
/**
- * RegistryCenter hold and persist instance state.
+ * Registry center.
*/
public final class RegistryCenter {
@@ -36,9 +36,9 @@ public final class RegistryCenter {
private final OrchestrationInstance instance;
public RegistryCenter(final String name, final RegistryRepository
registryRepository) {
- this.node = new RegistryCenterNode(name);
- this.repository = registryRepository;
- this.instance = OrchestrationInstance.getInstance();
+ node = new RegistryCenterNode(name);
+ repository = registryRepository;
+ instance = OrchestrationInstance.getInstance();
}
/**
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/constants/DataSourceBeanDefinitionTag.java
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/constants/DataS
[...]
index 36cd4a6..2d86cbb 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/constants/DataSourceBeanDefinitionTag.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/constants/DataSourceBeanDefinitionTag.java
@@ -28,9 +28,13 @@ public final class DataSourceBeanDefinitionTag {
public static final String ROOT_TAG = "data-source";
+ public static final String ID_ATTRIBUTE = "id";
+
public static final String DATA_SOURCE_REF_ATTRIBUTE = "data-source-ref";
- public static final String INSTANCE_REF_ATTRIBUTE = "instance-ref";
+ public static final String REG_CENTER_REF_ATTRIBUTE = "reg-center-ref";
+
+ public static final String CONFIG_CENTER_REF_ATTRIBUTE =
"config-center-ref";
public static final String CLUSTER_REF_ATTRIBUTE = "cluster-ref";
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/constants/OrchestrationCenterConfigurationBeanDefinitionTag.java
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchest
[...]
index 5d219a6..c682ef6 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/constants/OrchestrationCenterConfigurationBeanDefinitionTag.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/constants/OrchestrationCenterConfigurationBeanDefinitionTag.java
@@ -26,7 +26,9 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class OrchestrationCenterConfigurationBeanDefinitionTag {
- public static final String ROOT_TAG = "instance";
+ public static final String REG_CENTER_ROOT_TAG = "reg-center";
+
+ public static final String CONFIG_CENTER_ROOT_TAG = "config-center";
public static final String TYPE_ATTRIBUTE = "type";
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/handler/OrchestrationNamespaceHandler.java
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/handler/Orchest
[...]
index 1c70ce7..aeb7019 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/handler/OrchestrationNamespaceHandler.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/handler/OrchestrationNamespaceHandler.java
@@ -30,7 +30,8 @@ public final class OrchestrationNamespaceHandler extends
NamespaceHandlerSupport
@Override
public void init() {
-
registerBeanDefinitionParser(OrchestrationCenterConfigurationBeanDefinitionTag.ROOT_TAG,
new OrchestrationCenterConfigurationBeanDefinitionParser());
+
registerBeanDefinitionParser(OrchestrationCenterConfigurationBeanDefinitionTag.REG_CENTER_ROOT_TAG,
new OrchestrationCenterConfigurationBeanDefinitionParser());
+
registerBeanDefinitionParser(OrchestrationCenterConfigurationBeanDefinitionTag.CONFIG_CENTER_ROOT_TAG,
new OrchestrationCenterConfigurationBeanDefinitionParser());
registerBeanDefinitionParser(DataSourceBeanDefinitionTag.ROOT_TAG, new
DataSourceBeanDefinitionParser());
}
}
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/parser/DataSourceBeanDefinitionParser.java
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/parser/DataSour
[...]
index d555bc6..ed36131 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/parser/DataSourceBeanDefinitionParser.java
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/parser/DataSourceBeanDefinitionParser.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.spring.namespace.orchestration.parser;
-import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import
org.apache.shardingsphere.driver.orchestration.internal.datasource.OrchestrationShardingSphereDataSource;
import
org.apache.shardingsphere.orchestration.repository.api.config.OrchestrationConfiguration;
@@ -29,8 +28,6 @@ import
org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
-import java.util.List;
-
/**
* Data source parser for spring namespace.
*/
@@ -57,12 +54,10 @@ public final class DataSourceBeanDefinitionParser extends
AbstractBeanDefinition
private BeanDefinition getOrchestrationConfiguration(final Element
element) {
BeanDefinitionBuilder factory =
BeanDefinitionBuilder.rootBeanDefinition(OrchestrationConfiguration.class);
- List<String> instances =
Splitter.on(",").trimResults().splitToList(element.getAttribute(DataSourceBeanDefinitionTag.INSTANCE_REF_ATTRIBUTE));
- factory.addConstructorArgValue(instances.get(0));
- factory.addConstructorArgReference(instances.get(0));
- if (instances.size() > 1) {
- factory.addConstructorArgValue(instances.get(1));
- factory.addConstructorArgReference(instances.get(1));
+
factory.addConstructorArgValue(element.getAttribute(DataSourceBeanDefinitionTag.ID_ATTRIBUTE));
+
factory.addConstructorArgReference(element.getAttribute(DataSourceBeanDefinitionTag.REG_CENTER_REF_ATTRIBUTE));
+ if
(!Strings.isNullOrEmpty(element.getAttribute(DataSourceBeanDefinitionTag.CONFIG_CENTER_REF_ATTRIBUTE)))
{
+
factory.addConstructorArgReference(element.getAttribute(DataSourceBeanDefinitionTag.CONFIG_CENTER_REF_ATTRIBUTE));
}
factory.addConstructorArgValue(element.getAttribute(DataSourceBeanDefinitionTag.OVERWRITE_ATTRIBUTE));
return factory.getBeanDefinition();
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/cluster.xsd
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/cluster.xsd
index 40b1035..1453435 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/cluster.xsd
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/cluster.xsd
@@ -25,11 +25,11 @@
<xsd:element name="heartbeat">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="required" />
- <xsd:attribute name="sql" type="xsd:string" use="required"/>
+ <xsd:attribute name="sql" type="xsd:string" use="required" />
<xsd:attribute name="threadCount" type="xsd:string" use="required"
/>
- <xsd:attribute name="interval" type="xsd:string" use="required"/>
- <xsd:attribute name="retryMaximum" type="xsd:string"/>
- <xsd:attribute name="retryInterval" type="xsd:string"/>
+ <xsd:attribute name="interval" type="xsd:string" use="required" />
+ <xsd:attribute name="retryMaximum" type="xsd:string" />
+ <xsd:attribute name="retryInterval" type="xsd:string" />
<xsd:attribute name="retryEnable" type="xsd:string"
default="false" />
</xsd:complexType>
</xsd:element>
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd
index 596677d..51480b1 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd
@@ -27,13 +27,25 @@
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="data-source-ref" type="xsd:string" />
- <xsd:attribute name="instance-ref" type="xsd:string"
use="required" />
+ <xsd:attribute name="reg-center-ref" type="xsd:string"
use="required" />
+ <xsd:attribute name="config-center-ref" type="xsd:string" />
<xsd:attribute name="cluster-ref" type="xsd:string" />
<xsd:attribute name="overwrite" type="xsd:string" default="false"
/>
</xsd:complexType>
</xsd:element>
- <xsd:element name="instance">
+ <xsd:element name="reg-center">
+ <xsd:complexType>
+ <xsd:all>
+ <xsd:element ref="beans:props" minOccurs="0" />
+ </xsd:all>
+ <xsd:attribute name="id" type="xsd:string" use="required" />
+ <xsd:attribute name="type" type="xsd:string" use="required" />
+ <xsd:attribute name="server-lists" type="xsd:string"
use="required" />
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="config-center">
<xsd:complexType>
<xsd:all>
<xsd:element ref="beans:props" minOccurs="0" />
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/encryptOrchestration.xml
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/encryptOrchestration.xml
index 69d2c3b..4a458fd 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/encryptOrchestration.xml
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/encryptOrchestration.xml
@@ -25,12 +25,12 @@
">
<import resource="namespace/encryptDataSourceNamespace.xml" />
- <orchestration:instance id="regCenter" type="TestRegistry"
server-lists="localhost:3181">
+ <orchestration:reg-center id="regCenter" type="TestRegistry"
server-lists="localhost:3181">
<props>
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">1000</prop>
</props>
- </orchestration:instance>
+ </orchestration:reg-center>
- <orchestration:data-source id="encryptDataSourceOrchestration"
data-source-ref="encryptDataSource" instance-ref="regCenter" />
+ <orchestration:data-source id="encryptDataSourceOrchestration"
data-source-ref="encryptDataSource" reg-center-ref="regCenter" />
</beans>
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml
index 59390f3..a6e9cad 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml
@@ -26,15 +26,15 @@
">
<import resource="namespace/masterSlaveDataSourceNamespace.xml" />
- <orchestration:instance id="regCenter" type="TestRegistry"
server-lists="localhost:3181">
+ <orchestration:reg-center id="regCenter" type="TestRegistry"
server-lists="localhost:3181">
<props>
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">1000</prop>
</props>
- </orchestration:instance>
+ </orchestration:reg-center>
- <orchestration:data-source id="defaultMasterSlaveDataSourceOrchestration"
data-source-ref="defaultMasterSlaveDataSource" instance-ref="regCenter" />
- <orchestration:data-source id="randomMasterSlaveDataSourceOrchestration"
data-source-ref="randomMasterSlaveDataSource" instance-ref="regCenter" />
- <orchestration:data-source
id="roundRobinMasterSlaveDataSourceOrchestration"
data-source-ref="roundRobinMasterSlaveDataSource" instance-ref="regCenter" />
- <orchestration:data-source id="refMasterSlaveDataSourceOrchestration"
data-source-ref="refMasterSlaveDataSource" instance-ref="regCenter" />
+ <orchestration:data-source id="defaultMasterSlaveDataSourceOrchestration"
data-source-ref="defaultMasterSlaveDataSource" reg-center-ref="regCenter" />
+ <orchestration:data-source id="randomMasterSlaveDataSourceOrchestration"
data-source-ref="randomMasterSlaveDataSource" reg-center-ref="regCenter" />
+ <orchestration:data-source
id="roundRobinMasterSlaveDataSourceOrchestration"
data-source-ref="roundRobinMasterSlaveDataSource" reg-center-ref="regCenter" />
+ <orchestration:data-source id="refMasterSlaveDataSourceOrchestration"
data-source-ref="refMasterSlaveDataSource" reg-center-ref="regCenter" />
</beans>
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml
index 8446426..23eac5a 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml
@@ -26,13 +26,13 @@
">
<import resource="namespace/shardingMasterSlaveNamespace.xml" />
- <orchestration:instance id="regCenter" type="TestRegistry"
server-lists="localhost:3181">
+ <orchestration:reg-center id="regCenter" type="TestRegistry"
server-lists="localhost:3181">
<props>
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">1000</prop>
</props>
- </orchestration:instance>
+ </orchestration:reg-center>
- <orchestration:data-source
id="masterSlaveShardingDataSourceByDefaultStrategyOrchestration"
data-source-ref="masterSlaveShardingDataSourceByDefaultStrategy"
instance-ref="regCenter" />
- <orchestration:data-source
id="masterSlaveShardingDataSourceByUserStrategyOrchestration"
data-source-ref="masterSlaveShardingDataSourceByUserStrategy"
instance-ref="regCenter" />
+ <orchestration:data-source
id="masterSlaveShardingDataSourceByDefaultStrategyOrchestration"
data-source-ref="masterSlaveShardingDataSourceByDefaultStrategy"
reg-center-ref="regCenter" />
+ <orchestration:data-source
id="masterSlaveShardingDataSourceByUserStrategyOrchestration"
data-source-ref="masterSlaveShardingDataSourceByUserStrategy"
reg-center-ref="regCenter" />
</beans>
diff --git
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml
index 0d8dd7d..7ae49f0 100644
---
a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml
+++
b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml
@@ -34,20 +34,20 @@
<prop key="operation-timeout-milliseconds">1000</prop>
</util:properties>
- <orchestration:instance id="centerRepository" type="TestRegistry"
server-lists="localhost:3181">
+ <orchestration:reg-center id="registryRepository" type="TestRegistry"
server-lists="localhost:3181">
<props>
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">1000</prop>
</props>
- </orchestration:instance>
+ </orchestration:reg-center>
- <orchestration:data-source id="simpleShardingOrchestration"
data-source-ref="simpleShardingDataSource" instance-ref="centerRepository" />
- <orchestration:data-source
id="shardingRuleWithAttributesDataSourceOrchestration"
data-source-ref="shardingRuleWithAttributesDataSource"
instance-ref="centerRepository" />
- <orchestration:data-source id="multiTableRulesDataSourceOrchestration"
data-source-ref="multiTableRulesDataSource" instance-ref="centerRepository" />
- <orchestration:data-source id="propsDataSourceOrchestration"
data-source-ref="propsDataSource" instance-ref="centerRepository" />
- <orchestration:data-source
id="tableRuleWithAttributesDataSourceOrchestration"
data-source-ref="tableRuleWithAttributesDataSource"
instance-ref="centerRepository" />
- <orchestration:data-source id="bindingTableRuleDatasourceOrchestration"
data-source-ref="bindingTableRuleDatasource" instance-ref="centerRepository" />
- <orchestration:data-source
id="multiBindingTableRulesDatasourceOrchestration"
data-source-ref="multiBindingTableRulesDatasource"
instance-ref="centerRepository" />
- <orchestration:data-source id="broadcastTableRuleDatasourceOrchestration"
data-source-ref="broadcastTableRuleDatasource" instance-ref="centerRepository"
/>
- <orchestration:data-source
id="multiBroadcastTableRulesDatasourceOrchestration"
data-source-ref="multiBroadcastTableRulesDatasource"
instance-ref="centerRepository" />
+ <orchestration:data-source id="simpleShardingOrchestration"
data-source-ref="simpleShardingDataSource" reg-center-ref="registryRepository"
/>
+ <orchestration:data-source
id="shardingRuleWithAttributesDataSourceOrchestration"
data-source-ref="shardingRuleWithAttributesDataSource"
reg-center-ref="registryRepository" />
+ <orchestration:data-source id="multiTableRulesDataSourceOrchestration"
data-source-ref="multiTableRulesDataSource" reg-center-ref="registryRepository"
/>
+ <orchestration:data-source id="propsDataSourceOrchestration"
data-source-ref="propsDataSource" reg-center-ref="registryRepository" />
+ <orchestration:data-source
id="tableRuleWithAttributesDataSourceOrchestration"
data-source-ref="tableRuleWithAttributesDataSource"
reg-center-ref="registryRepository" />
+ <orchestration:data-source id="bindingTableRuleDatasourceOrchestration"
data-source-ref="bindingTableRuleDatasource"
reg-center-ref="registryRepository" />
+ <orchestration:data-source
id="multiBindingTableRulesDatasourceOrchestration"
data-source-ref="multiBindingTableRulesDatasource"
reg-center-ref="registryRepository" />
+ <orchestration:data-source id="broadcastTableRuleDatasourceOrchestration"
data-source-ref="broadcastTableRuleDatasource"
reg-center-ref="registryRepository" />
+ <orchestration:data-source
id="multiBroadcastTableRulesDatasourceOrchestration"
data-source-ref="multiBroadcastTableRulesDatasource"
reg-center-ref="registryRepository" />
</beans>
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-orchestration/src/main/java/org/apache/shardingsphere/proxy/orchestration/OrchestrationConfigurationConverter.java
b/shardingsphere-proxy/shardingsphere-proxy-orchestration/src/main/java/org/apache/shardingsphere/proxy/orchestration/OrchestrationConfigurationConverter.java
index 9909b27..e803df0 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-orchestration/src/main/java/org/apache/shardingsphere/proxy/orchestration/OrchestrationConfigurationConverter.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-orchestration/src/main/java/org/apache/shardingsphere/proxy/orchestration/OrchestrationConfigurationConverter.java
@@ -105,7 +105,7 @@ public final class OrchestrationConfigurationConverter
extends AbstractConfigura
private Map<String, Map<String, DataSourceParameter>>
getDataSourceParametersMap(final OrchestrationFacade orchestrationFacade) {
Map<String, Map<String, DataSourceParameter>> result = new
LinkedHashMap<>();
- for (String each :
orchestrationFacade.getConfigCenter().getAllShardingSchemaNames()) {
+ for (String each :
orchestrationFacade.getConfigCenter().getAllSchemaNames()) {
result.put(each,
DataSourceConverter.getDataSourceParameterMap(orchestrationFacade.getConfigCenter().loadDataSourceConfigurations(each)));
}
return result;
@@ -113,7 +113,7 @@ public final class OrchestrationConfigurationConverter
extends AbstractConfigura
private Map<String, Collection<RuleConfiguration>> getSchemaRules(final
OrchestrationFacade orchestrationFacade) {
Map<String, Collection<RuleConfiguration>> result = new
LinkedHashMap<>();
- for (String each :
orchestrationFacade.getConfigCenter().getAllShardingSchemaNames()) {
+ for (String each :
orchestrationFacade.getConfigCenter().getAllSchemaNames()) {
result.put(each,
orchestrationFacade.getConfigCenter().loadRuleConfigurations(each));
}
return result;