From 2c52e1e589ae2084d0f181d23ec1dafb2d23f565 Mon Sep 17 00:00:00 2001 From: caohao Date: Mon, 15 Oct 2018 19:45:42 +0800 Subject: [PATCH 01/30] for #1316, update delete_with_special_character_without_sharding_value test case 1th. --- sharding-sql-test/src/main/resources/sql/dml/delete.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding-sql-test/src/main/resources/sql/dml/delete.xml b/sharding-sql-test/src/main/resources/sql/dml/delete.xml index e666055cbe28f..bb5764aec16e6 100644 --- a/sharding-sql-test/src/main/resources/sql/dml/delete.xml +++ b/sharding-sql-test/src/main/resources/sql/dml/delete.xml @@ -2,7 +2,7 @@ - + From a59a0282febaebe4a363d9aa24f9cadda27d9c02 Mon Sep 17 00:00:00 2001 From: caohao Date: Mon, 15 Oct 2018 21:27:36 +0800 Subject: [PATCH 02/30] for #1316, update delete_with_special_character_without_sharding_value test case 2th. --- sharding-core/src/test/resources/parser/delete.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding-core/src/test/resources/parser/delete.xml b/sharding-core/src/test/resources/parser/delete.xml index 47d26a64e4bda..e4d7e92d11a60 100644 --- a/sharding-core/src/test/resources/parser/delete.xml +++ b/sharding-core/src/test/resources/parser/delete.xml @@ -33,7 +33,7 @@ - + From 16299d08fb2832848488941335e3e9741e3308a7 Mon Sep 17 00:00:00 2001 From: caohao Date: Mon, 15 Oct 2018 21:27:53 +0800 Subject: [PATCH 03/30] for #1316, update insert_with_special_syntax test case 1th. --- sharding-sql-test/src/main/resources/sql/dml/insert.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding-sql-test/src/main/resources/sql/dml/insert.xml b/sharding-sql-test/src/main/resources/sql/dml/insert.xml index af7be2f83fd8b..84df43f91730b 100644 --- a/sharding-sql-test/src/main/resources/sql/dml/insert.xml +++ b/sharding-sql-test/src/main/resources/sql/dml/insert.xml @@ -3,7 +3,7 @@ - + From 430a2266acf0d52f2e002ffc134bdb6de441a0f9 Mon Sep 17 00:00:00 2001 From: caohao Date: Mon, 15 Oct 2018 21:28:01 +0800 Subject: [PATCH 04/30] for #1316, update insert_with_special_syntax test case 2th. --- sharding-core/src/test/resources/parser/insert.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sharding-core/src/test/resources/parser/insert.xml b/sharding-core/src/test/resources/parser/insert.xml index 841e2bfa6fcc2..a52e68d90479d 100644 --- a/sharding-core/src/test/resources/parser/insert.xml +++ b/sharding-core/src/test/resources/parser/insert.xml @@ -93,8 +93,8 @@
- - + + From 29ca51c5b9d0d88e927a87a330760fdf6a3b56ff Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 10:13:28 +0800 Subject: [PATCH 05/30] for #1316, update delete_with_special_character_without_sharding_value test case. --- sharding-sql-test/src/main/resources/sql/dml/delete.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding-sql-test/src/main/resources/sql/dml/delete.xml b/sharding-sql-test/src/main/resources/sql/dml/delete.xml index bb5764aec16e6..b0e5d0fdf945f 100644 --- a/sharding-sql-test/src/main/resources/sql/dml/delete.xml +++ b/sharding-sql-test/src/main/resources/sql/dml/delete.xml @@ -2,7 +2,7 @@ - + From 23dcfb65a7cdef6ca94bc81056d2b21ba789e944 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 10:13:58 +0800 Subject: [PATCH 06/30] for #1316, update delete_without_sharding_value test case. --- sharding-core/src/test/resources/parser/delete.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sharding-core/src/test/resources/parser/delete.xml b/sharding-core/src/test/resources/parser/delete.xml index e4d7e92d11a60..bee281e22040e 100644 --- a/sharding-core/src/test/resources/parser/delete.xml +++ b/sharding-core/src/test/resources/parser/delete.xml @@ -26,6 +26,13 @@ + + + + + + + From 51cafb75fe8bc4e51a314964108d26e1bafb5d1e Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 10:14:56 +0800 Subject: [PATCH 07/30] for #1316, update delete_with_special_character_without_sharding_value test case 2th. --- .../resources/integrate/cases/dml/dml-integrate-test-cases.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dml/dml-integrate-test-cases.xml b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dml/dml-integrate-test-cases.xml index 1efe4ae591e5e..ad46b756e9e68 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dml/dml-integrate-test-cases.xml +++ b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dml/dml-integrate-test-cases.xml @@ -145,7 +145,7 @@ - + From 3b006418239596b7938912b01def95a133d4b00d Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 10:17:25 +0800 Subject: [PATCH 08/30] for #1316, update delete_without_sharding_value test case 2th. --- sharding-core/src/test/resources/parser/delete.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sharding-core/src/test/resources/parser/delete.xml b/sharding-core/src/test/resources/parser/delete.xml index bee281e22040e..e4d7e92d11a60 100644 --- a/sharding-core/src/test/resources/parser/delete.xml +++ b/sharding-core/src/test/resources/parser/delete.xml @@ -26,13 +26,6 @@ - - - - - - - From 817c4fbd587d7a65cc6d2b3459c08d02c56754a5 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 10:17:53 +0800 Subject: [PATCH 09/30] for #1316, removed useless properties config. --- .../src/test/resources/integrate/env.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/env.properties b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/env.properties index a29bd88a939ae..d0dba0c6be7b0 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/env.properties +++ b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/env.properties @@ -1,4 +1,3 @@ -initialized=false run.additional.cases=false sharding.rule.type=db,tbl,dbtbl_with_masterslave,masterslave From 59715509d5a4acf409b0f47a4f7af59c86734fc0 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 13:47:53 +0800 Subject: [PATCH 10/30] for #1316, update select_pagination_with_diff_group_by_and_order_by test case. --- .../parser/select_pagination_group_by_order_by.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sharding-core/src/test/resources/parser/select_pagination_group_by_order_by.xml b/sharding-core/src/test/resources/parser/select_pagination_group_by_order_by.xml index 7794c9ad728fd..9184569858780 100644 --- a/sharding-core/src/test/resources/parser/select_pagination_group_by_order_by.xml +++ b/sharding-core/src/test/resources/parser/select_pagination_group_by_order_by.xml @@ -44,13 +44,14 @@
- - - - - + + + + + i.item_id AS ORDER_BY_DERIVED_0 + i.user_id AS GROUP_BY_DERIVED_0 @@ -67,7 +68,7 @@ - + From 1c3004fb440bcb78e70547ba703ef33c41d04836 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 13:48:19 +0800 Subject: [PATCH 11/30] for #1316, update select_pagination_with_diff_group_by_and_order_by 2th. --- .../resources/sql/dql/select_pagination_group_by_order_by.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding-sql-test/src/main/resources/sql/dql/select_pagination_group_by_order_by.xml b/sharding-sql-test/src/main/resources/sql/dql/select_pagination_group_by_order_by.xml index 846469abb43f7..f86e28b8f653a 100644 --- a/sharding-sql-test/src/main/resources/sql/dql/select_pagination_group_by_order_by.xml +++ b/sharding-sql-test/src/main/resources/sql/dql/select_pagination_group_by_order_by.xml @@ -1,7 +1,7 @@ - + From e0b61a909c6fe9504b1d9cd0bebf6e74e090aa90 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 13:48:31 +0800 Subject: [PATCH 12/30] for #1316, update select_pagination_with_diff_group_by_and_order_by 3th. --- .../select_pagination_with_diff_group_by_and_order_by.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/db/select_pagination_with_diff_group_by_and_order_by.xml b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/db/select_pagination_with_diff_group_by_and_order_by.xml index 503caa44a7029..0529e21af9a86 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/db/select_pagination_with_diff_group_by_and_order_by.xml +++ b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/db/select_pagination_with_diff_group_by_and_order_by.xml @@ -2,11 +2,5 @@ - - - - - - From 783b9dc5be308b0092ea094cd14ebb68fb45c3a9 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 13:48:44 +0800 Subject: [PATCH 13/30] for #1316, update select_pagination_with_diff_group_by_and_order_by 4th. --- ...select_pagination_with_diff_group_by_and_order_by.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/dbtbl_with_masterslave/select_pagination_with_diff_group_by_and_order_by.xml b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/dbtbl_with_masterslave/select_pagination_with_diff_group_by_and_order_by.xml index ed9e4b66bf285..9e1d58d46dd04 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/dbtbl_with_masterslave/select_pagination_with_diff_group_by_and_order_by.xml +++ b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/dbtbl_with_masterslave/select_pagination_with_diff_group_by_and_order_by.xml @@ -3,13 +3,4 @@ - - - - - - - - - From e9e1c18ecb1f4f3ee370f2b797f2d7a8c15e5e93 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 13:48:54 +0800 Subject: [PATCH 14/30] for #1316, update select_pagination_with_diff_group_by_and_order_by 5th. --- .../select_pagination_with_diff_group_by_and_order_by.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/masterslave/select_pagination_with_diff_group_by_and_order_by.xml b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/masterslave/select_pagination_with_diff_group_by_and_order_by.xml index 503caa44a7029..0529e21af9a86 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/masterslave/select_pagination_with_diff_group_by_and_order_by.xml +++ b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/masterslave/select_pagination_with_diff_group_by_and_order_by.xml @@ -2,11 +2,5 @@ - - - - - - From 260e6d7cb7fe0cff0a04fe09449dfc3080a012ff Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 13:49:02 +0800 Subject: [PATCH 15/30] for #1316, update select_pagination_with_diff_group_by_and_order_by 6th. --- ...select_pagination_with_diff_group_by_and_order_by.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/tbl/select_pagination_with_diff_group_by_and_order_by.xml b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/tbl/select_pagination_with_diff_group_by_and_order_by.xml index 6525f7ca9743b..0529e21af9a86 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/tbl/select_pagination_with_diff_group_by_and_order_by.xml +++ b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/tbl/select_pagination_with_diff_group_by_and_order_by.xml @@ -3,13 +3,4 @@ - - - - - - - - - From 60be36888efa83a564d086d4beb371d18d84f396 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 16:23:47 +0800 Subject: [PATCH 16/30] for #1316, update select_pagination_with_diff_group_by_and_order_by 7th. --- .../parser/select_pagination_group_by_order_by.xml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sharding-core/src/test/resources/parser/select_pagination_group_by_order_by.xml b/sharding-core/src/test/resources/parser/select_pagination_group_by_order_by.xml index 9184569858780..7794c9ad728fd 100644 --- a/sharding-core/src/test/resources/parser/select_pagination_group_by_order_by.xml +++ b/sharding-core/src/test/resources/parser/select_pagination_group_by_order_by.xml @@ -44,14 +44,13 @@
- - - - - + + + + + i.item_id AS ORDER_BY_DERIVED_0 - i.user_id AS GROUP_BY_DERIVED_0 @@ -68,7 +67,7 @@ - + From 0c1c846a451de2fc04c8438762b7b39ea9bcf5f5 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 16:23:58 +0800 Subject: [PATCH 17/30] for #1316, update select_pagination_with_diff_group_by_and_order_by 8th. --- .../resources/sql/dql/select_pagination_group_by_order_by.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding-sql-test/src/main/resources/sql/dql/select_pagination_group_by_order_by.xml b/sharding-sql-test/src/main/resources/sql/dql/select_pagination_group_by_order_by.xml index f86e28b8f653a..846469abb43f7 100644 --- a/sharding-sql-test/src/main/resources/sql/dql/select_pagination_group_by_order_by.xml +++ b/sharding-sql-test/src/main/resources/sql/dql/select_pagination_group_by_order_by.xml @@ -1,7 +1,7 @@ - + From 14ad35ebcb830a059d5750e34494d56820bae460 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 16:38:27 +0800 Subject: [PATCH 18/30] for #1316, update select_pagination_with_diff_group_by_and_order_by 9th. --- .../select_pagination_with_diff_group_by_and_order_by.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/dbtbl_with_masterslave/select_pagination_with_diff_group_by_and_order_by.xml b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/dbtbl_with_masterslave/select_pagination_with_diff_group_by_and_order_by.xml index 9e1d58d46dd04..0529e21af9a86 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/dbtbl_with_masterslave/select_pagination_with_diff_group_by_and_order_by.xml +++ b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/dbtbl_with_masterslave/select_pagination_with_diff_group_by_and_order_by.xml @@ -2,5 +2,5 @@ - + From e3e246c742377edc40fa085bb426c24735d6ce64 Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 16:38:36 +0800 Subject: [PATCH 19/30] for #1316, update select_pagination_with_diff_group_by_and_order_by 10th. --- .../tbl/select_pagination_with_diff_group_by_and_order_by.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/tbl/select_pagination_with_diff_group_by_and_order_by.xml b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/tbl/select_pagination_with_diff_group_by_and_order_by.xml index 0529e21af9a86..f61551fc142d3 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/tbl/select_pagination_with_diff_group_by_and_order_by.xml +++ b/sharding-jdbc/sharding-jdbc-core/src/test/resources/integrate/cases/dql/dataset/tbl/select_pagination_with_diff_group_by_and_order_by.xml @@ -2,5 +2,4 @@ - From ae39a2cbb4f6b1e4043b7e3a2ac70d1f122eb66d Mon Sep 17 00:00:00 2001 From: caohao Date: Tue, 16 Oct 2018 20:45:34 +0800 Subject: [PATCH 20/30] for #1316, update datasource connection size. --- .../shardingsphere/dbtest/env/datasource/DataSourceUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/dbtest/env/datasource/DataSourceUtil.java b/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/dbtest/env/datasource/DataSourceUtil.java index 6ab7a73c2719c..683dd19dbf58a 100644 --- a/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/dbtest/env/datasource/DataSourceUtil.java +++ b/sharding-jdbc/sharding-jdbc-core/src/test/java/io/shardingsphere/dbtest/env/datasource/DataSourceUtil.java @@ -78,7 +78,7 @@ private static DataSource createDBCP(final DatabaseType databaseType, final Stri result.setUrl(null == dataSourceName ? databaseEnvironment.getURL() : databaseEnvironment.getURL(dataSourceName)); result.setUsername(databaseEnvironment.getUsername()); result.setPassword(databaseEnvironment.getPassword()); - result.setMaxTotal(5); + result.setMaxTotal(15); result.setValidationQuery("SELECT 1"); if (DatabaseType.Oracle == databaseType) { result.setConnectionInitSqls(Collections.singleton("ALTER SESSION SET CURRENT_SCHEMA = " + dataSourceName)); @@ -93,7 +93,7 @@ private static DataSource createHikariCP(final DatabaseType databaseType, final result.setJdbcUrl(null == dataSourceName ? databaseEnvironment.getURL() : databaseEnvironment.getURL(dataSourceName)); result.setUsername(databaseEnvironment.getUsername()); result.setPassword(databaseEnvironment.getPassword()); - result.setMaximumPoolSize(5); + result.setMaximumPoolSize(15); result.setTransactionIsolation("TRANSACTION_READ_COMMITTED"); result.setConnectionTestQuery("SELECT 1"); if (DatabaseType.Oracle == databaseType) { From cd2d0a92edc5d9ccef771e849fb61a5a8bc7e70d Mon Sep 17 00:00:00 2001 From: terrymanu Date: Wed, 17 Oct 2018 14:25:44 +0800 Subject: [PATCH 21/30] for #1215, make constant with zookeeper and etcd config --- ...itional-spring-configuration-metadata.json | 77 +++++++++---------- ...RegistryCenterBeanDefinitionParserTag.java | 6 +- ...RegistryCenterBeanDefinitionParserTag.java | 10 +-- .../parser/RegBeanDefinitionParser.java | 15 ++-- .../META-INF/namespace/orchestration.xsd | 11 ++- .../META-INF/rdb/masterSlaveOrchestration.xml | 2 +- .../rdb/shardingMasterSlaveOrchestration.xml | 6 +- .../META-INF/rdb/shardingOrchestration.xml | 2 +- .../sharding-orchestration-reg/pom.xml | 3 +- .../reg/etcd/EtcdConfiguration.java | 14 ++-- .../reg/etcd/EtcdRegistryCenter.java | 14 ++-- .../reg/newzk/NewZookeeperRegistryCenter.java | 8 +- .../reg/zookeeper/ZookeeperConfiguration.java | 29 +++---- .../zookeeper/ZookeeperRegistryCenter.java | 12 +-- 14 files changed, 96 insertions(+), 113 deletions(-) diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index e6f2a9207f3df..4f3b123468199 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -78,89 +78,82 @@ }, { "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "defaultValue": 3, - "name": "sharding.jdbc.config.orchestration.etcd.max-retries", - "description": "Maximal retries when calling a etcd method.", - "type": "java.lang.Integer" + "name": "sharding.jdbc.config.orchestration.etcd.server-lists", + "description": "Etcd server list.\n \n

Include ip address and port, multiple servers split by comma. Etc: {@code http:\/\/host1:2379,http:\/\/host2:2379}<\/p>.", + "type": "java.lang.String" }, { "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "defaultValue": 200, - "name": "sharding.jdbc.config.orchestration.etcd.retry-interval-milliseconds", - "description": "Maximal retries when calling a etcd method.", + "defaultValue": 500, + "name": "sharding.jdbc.config.orchestration.etcd.operation-timeout-milliseconds", + "description": "Operation timeout time in milliseconds.", "type": "java.lang.Integer" }, { "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "name": "sharding.jdbc.config.orchestration.etcd.server-lists", - "description": "Etcd server list.\n \n

Include ip address and port, multiple servers split by comma. Etc: {@code http:\/\/host1:2379,http:\/\/host2:2379}<\/p>.", - "type": "java.lang.String" + "defaultValue": 3, + "name": "sharding.jdbc.config.orchestration.etcd.max-retries", + "description": "Max number of times to retry.", + "type": "java.lang.Integer" }, { "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "defaultValue": 60, - "name": "sharding.jdbc.config.orchestration.etcd.time-to-live-seconds", - "description": "Time to live seconds of ephemeral keys.", + "defaultValue": 200, + "name": "sharding.jdbc.config.orchestration.etcd.retry-interval-milliseconds", + "description": "Time interval in milliseconds on each retry.", "type": "java.lang.Integer" }, { "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "defaultValue": 500, - "name": "sharding.jdbc.config.orchestration.etcd.timeout-milliseconds", - "description": "Timeout when calling a etcd method in milliseconds.", + "defaultValue": 60, + "name": "sharding.jdbc.config.orchestration.etcd.time-to-live-seconds", + "description": "Time to live in seconds of ephemeral keys.", "type": "java.lang.Integer" }, { "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", - "defaultValue": 1000, - "name": "sharding.jdbc.config.orchestration.zookeeper.base-sleep-time-milliseconds", - "description": "Base sleep time milliseconds.", - "type": "java.lang.Integer" + "name": "sharding.jdbc.config.orchestration.zookeeper.server-lists", + "description": "Zookeeper server list.\n \n

Include ip address and port, multiple servers split by comma. Etc: {@code host1:2181,host2:2181}<\/p>.", + "type": "java.lang.String" }, { "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", - "defaultValue": 0, - "name": "sharding.jdbc.config.orchestration.zookeeper.connection-timeout-milliseconds", - "description": "Connection timeout milliseconds.", - "type": "java.lang.Integer" + "name": "sharding.jdbc.config.orchestration.zookeeper.namespace", + "description": "Namespace of registry center.", + "type": "java.lang.String" }, { "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", "name": "sharding.jdbc.config.orchestration.zookeeper.digest", - "description": "Digest for zookeeper.\n \n

Default is not need digest<\/p>.", + "description": "Digest for registry center.\n \n

Default is not need digest<\/p>.", "type": "java.lang.String" }, { "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", - "defaultValue": 3, - "name": "sharding.jdbc.config.orchestration.zookeeper.max-retries", - "description": "Max retries.", + "defaultValue": 0, + "name": "sharding.jdbc.config.orchestration.zookeeper.operation-timeout-milliseconds", + "description": "Operation timeout time in milliseconds.", "type": "java.lang.Integer" }, { "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", - "defaultValue": 3000, - "name": "sharding.jdbc.config.orchestration.zookeeper.max-sleep-time-milliseconds", - "description": "Max sleep time milliseconds.", + "defaultValue": 3, + "name": "sharding.jdbc.config.orchestration.zookeeper.max-retries", + "description": "Max number of times to retry.", "type": "java.lang.Integer" }, { "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", - "name": "sharding.jdbc.config.orchestration.zookeeper.namespace", - "description": "Namespace of zookeeper.", - "type": "java.lang.String" - }, - { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", - "name": "sharding.jdbc.config.orchestration.zookeeper.server-lists", - "description": "Zookeeper server list.\n \n

Include ip address and port, multiple servers split by comma. Etc: {@code host1:2181,host2:2181}<\/p>.", - "type": "java.lang.String" + "defaultValue": 1000, + "name": "sharding.jdbc.config.orchestration.zookeeper.retry-interval-milliseconds", + "description": "Time interval in milliseconds on each retry.", + "type": "java.lang.Integer" }, { "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", "defaultValue": 0, - "name": "sharding.jdbc.config.orchestration.zookeeper.session-timeout-milliseconds", - "description": "Session timeout milliseconds.", + "name": "sharding.jdbc.config.orchestration.zookeeper.time-to-live-seconds", + "description": "Time to live in seconds of ephemeral keys.", "type": "java.lang.Integer" }, { diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/EtcdRegistryCenterBeanDefinitionParserTag.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/EtcdRegistryCenterBeanDefinitionParserTag.java index a1d47ba1bef6a..21f42c4f97470 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/EtcdRegistryCenterBeanDefinitionParserTag.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/EtcdRegistryCenterBeanDefinitionParserTag.java @@ -32,11 +32,11 @@ public final class EtcdRegistryCenterBeanDefinitionParserTag { public static final String SERVER_LISTS_TAG = "server-lists"; - public static final String TIME_TO_LIVE_SECONDS_TAG = "time-to-live-seconds"; + public static final String OPERATION_TIMEOUT_MILLISECONDS_TAG = "operation-timeout-milliseconds"; - public static final String TIMEOUT_MILLISECONDS_TAG = "timeout-milliseconds"; + public static final String MAX_RETRIES_TAG = "max-retries"; public static final String RETRY_INTERVAL_MILLISECONDS_TAG = "retry-interval-milliseconds"; - public static final String MAX_RETRIES_TAG = "max-retries"; + public static final String TIME_TO_LIVE_SECONDS_TAG = "time-to-live-seconds"; } diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/ZookeeperRegistryCenterBeanDefinitionParserTag.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/ZookeeperRegistryCenterBeanDefinitionParserTag.java index 0637aea5cb9bd..ad1035bd9ce46 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/ZookeeperRegistryCenterBeanDefinitionParserTag.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/ZookeeperRegistryCenterBeanDefinitionParserTag.java @@ -34,15 +34,13 @@ public final class ZookeeperRegistryCenterBeanDefinitionParserTag { public static final String NAMESPACE_TAG = "namespace"; - public static final String BASE_SLEEP_TIME_MILLISECONDS_TAG = "base-sleep-time-milliseconds"; + public static final String DIGEST_TAG = "digest"; - public static final String MAX_SLEEP_TIME_MILLISECONDS_TAG = "max-sleep-time-milliseconds"; + public static final String OPERATION_TIMEOUT_MILLISECONDS_TAG = "operation-timeout-milliseconds"; public static final String MAX_RETRIES_TAG = "max-retries"; - public static final String SESSION_TIMEOUT_MILLISECONDS_TAG = "session-timeout-milliseconds"; - - public static final String CONNECTION_TIMEOUT_MILLISECONDS_TAG = "connection-timeout-milliseconds"; + public static final String RETRY_INTERVAL_MILLISECONDS_TAG = "retry-interval-milliseconds"; - public static final String DIGEST_TAG = "digest"; + public static final String TIME_TO_LIVE_SECONDS_TAG = "time-to-live-seconds"; } diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java index 71fea8fa9349a..cbca58264508c 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java @@ -44,22 +44,21 @@ private AbstractBeanDefinition getZookeeperConfiguration(final Element element) BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(ZookeeperConfiguration.class); addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.SERVER_LISTS_TAG, "serverLists", element, factory); addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.NAMESPACE_TAG, "namespace", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.BASE_SLEEP_TIME_MILLISECONDS_TAG, "baseSleepTimeMilliseconds", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.MAX_SLEEP_TIME_MILLISECONDS_TAG, "maxSleepTimeMilliseconds", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.MAX_RETRIES_TAG, "maxRetries", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.SESSION_TIMEOUT_MILLISECONDS_TAG, "sessionTimeoutMilliseconds", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.CONNECTION_TIMEOUT_MILLISECONDS_TAG, "connectionTimeoutMilliseconds", element, factory); addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.DIGEST_TAG, "digest", element, factory); + addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.OPERATION_TIMEOUT_MILLISECONDS_TAG, "operationTimeoutMilliseconds", element, factory); + addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.MAX_RETRIES_TAG, "maxRetries", element, factory); + addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.RETRY_INTERVAL_MILLISECONDS_TAG, "retryIntervalMilliseconds", element, factory); + addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.TIME_TO_LIVE_SECONDS_TAG, "timeToLiveSeconds", element, factory); return factory.getBeanDefinition(); } private AbstractBeanDefinition getEtcdConfiguration(final Element element) { BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(EtcdConfiguration.class); addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.SERVER_LISTS_TAG, "serverLists", element, factory); - addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.TIME_TO_LIVE_SECONDS_TAG, "timeToLiveSeconds", element, factory); - addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.TIMEOUT_MILLISECONDS_TAG, "timeoutMilliseconds", element, factory); - addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.RETRY_INTERVAL_MILLISECONDS_TAG, "retryIntervalMilliseconds", element, factory); + addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.OPERATION_TIMEOUT_MILLISECONDS_TAG, "operationTimeoutMilliseconds", element, factory); addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.MAX_RETRIES_TAG, "maxRetries", element, factory); + addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.RETRY_INTERVAL_MILLISECONDS_TAG, "retryIntervalMilliseconds", element, factory); + addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.TIME_TO_LIVE_SECONDS_TAG, "timeToLiveSeconds", element, factory); return factory.getBeanDefinition(); } diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd index 61271afee2963..c16a63465bea3 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd @@ -27,12 +27,11 @@ - - - - - + + + + @@ -42,8 +41,8 @@ + - diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml index 57265a570d03c..d9aff6d9280c7 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml @@ -8,7 +8,7 @@ http://shardingsphere.io/schema/shardingsphere/orchestration/orchestration.xsd"> - + diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml index 6ba4da4159a0f..6041e0161ae14 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml @@ -7,9 +7,9 @@ http://shardingsphere.io/schema/shardingsphere/orchestration http://shardingsphere.io/schema/shardingsphere/orchestration/orchestration.xsd"> - - - + + + diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml index 60fca6866b19e..626ce4264d5bf 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml @@ -8,7 +8,7 @@ http://shardingsphere.io/schema/shardingsphere/orchestration/orchestration.xsd"> - + diff --git a/sharding-orchestration/sharding-orchestration-reg/pom.xml b/sharding-orchestration/sharding-orchestration-reg/pom.xml index efd0aa1b8ad39..78e0b91725c07 100644 --- a/sharding-orchestration/sharding-orchestration-reg/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/pom.xml @@ -39,11 +39,10 @@ com.github.rholder guava-retrying - + org.apache.curator curator-test - diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java index 6c27aa678afd5..74752b3c2e6ed 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java @@ -38,22 +38,22 @@ public final class EtcdConfiguration implements RegistryCenterConfiguration { private String serverLists; /** - * Time to live seconds of ephemeral keys. + * Operation timeout time in milliseconds. */ - private int timeToLiveSeconds = 60; + private int operationTimeoutMilliseconds = 500; /** - * Timeout when calling a etcd method in milliseconds. + * Max number of times to retry. */ - private int timeoutMilliseconds = 500; + private int maxRetries = 3; /** - * Maximal retries when calling a etcd method. + * Time interval in milliseconds on each retry. */ private int retryIntervalMilliseconds = 200; /** - * Maximal retries when calling a etcd method. + * Time to live in seconds of ephemeral keys. */ - private int maxRetries = 3; + private int timeToLiveSeconds = 60; } diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java index a91e69325e4b9..9bd9e60515500 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java @@ -23,14 +23,14 @@ import etcdserverpb.KVGrpc.KVFutureStub; import etcdserverpb.LeaseGrpc; import etcdserverpb.LeaseGrpc.LeaseFutureStub; -import etcdserverpb.Rpc.WatchCreateRequest; import etcdserverpb.Rpc.LeaseGrantRequest; import etcdserverpb.Rpc.PutRequest; import etcdserverpb.Rpc.RangeRequest; import etcdserverpb.Rpc.RangeResponse; +import etcdserverpb.Rpc.WatchCreateRequest; +import etcdserverpb.Rpc.WatchRequest; import etcdserverpb.WatchGrpc; import etcdserverpb.WatchGrpc.WatchStub; -import etcdserverpb.Rpc.WatchRequest; import io.grpc.Channel; import io.shardingsphere.orchestration.reg.api.RegistryCenter; import io.shardingsphere.orchestration.reg.etcd.internal.channel.EtcdChannelFactory; @@ -86,7 +86,7 @@ public String get(final String key) { @Override public String call() throws InterruptedException, ExecutionException, TimeoutException { - RangeResponse response = kvStub.range(request).get(etcdConfig.getTimeoutMilliseconds(), TimeUnit.MILLISECONDS); + RangeResponse response = kvStub.range(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); return response.getKvsCount() > 0 ? response.getKvs(0).getValue().toStringUtf8() : null; } }).orNull(); @@ -110,7 +110,7 @@ public List getChildrenKeys(final String key) { @Override public List call() throws InterruptedException, ExecutionException, TimeoutException { - RangeResponse response = kvStub.range(request).get(etcdConfig.getTimeoutMilliseconds(), TimeUnit.MILLISECONDS); + RangeResponse response = kvStub.range(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); List result = new ArrayList<>(); for (KeyValue each : response.getKvsList()) { String childFullPath = each.getKey().toStringUtf8(); @@ -129,7 +129,7 @@ public void persist(final String key, final String value) { @Override public Void call() throws InterruptedException, ExecutionException, TimeoutException { - kvStub.put(request).get(etcdConfig.getTimeoutMilliseconds(), TimeUnit.MILLISECONDS); + kvStub.put(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); return null; } }); @@ -151,7 +151,7 @@ public void persistEphemeral(final String key, final String value) { @Override public Void call() throws InterruptedException, ExecutionException, TimeoutException { - kvStub.put(request).get(etcdConfig.getTimeoutMilliseconds(), TimeUnit.MILLISECONDS); + kvStub.put(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); return null; } }); @@ -163,7 +163,7 @@ private Optional lease() { @Override public Long call() throws InterruptedException, ExecutionException, TimeoutException { - long leaseId = leaseStub.leaseGrant(request).get(etcdConfig.getTimeoutMilliseconds(), TimeUnit.MILLISECONDS).getID(); + long leaseId = leaseStub.leaseGrant(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS).getID(); keepAlive.heartbeat(leaseId); return leaseId; } diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java index ca71d95a85856..693a1aceb06f9 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java @@ -64,8 +64,8 @@ public NewZookeeperRegistryCenter(final ZookeeperConfiguration zkConfig) { private ClientFactory buildClientFactory(final ZookeeperConfiguration zkConfig) { ClientFactory result = new ClientFactory(); - result.setClientNamespace(zkConfig.getNamespace()).newClient(zkConfig.getServerLists(), zkConfig.getSessionTimeoutMilliseconds()) - .setRetryPolicy(new DelayRetryPolicy(zkConfig.getBaseSleepTimeMilliseconds(), zkConfig.getMaxRetries(), zkConfig.getMaxSleepTimeMilliseconds())); + result.setClientNamespace(zkConfig.getNamespace()).newClient(zkConfig.getServerLists(), zkConfig.getTimeToLiveSeconds() * 1000) + .setRetryPolicy(new DelayRetryPolicy(zkConfig.getRetryIntervalMilliseconds(), zkConfig.getMaxRetries(), zkConfig.getRetryIntervalMilliseconds())); if (!Strings.isNullOrEmpty(zkConfig.getDigest())) { result.authorization("digest", zkConfig.getDigest().getBytes(Charsets.UTF_8), ZooDefs.Ids.CREATOR_ALL_ACL); } @@ -76,9 +76,9 @@ private IClient initClient(final ClientFactory clientFactory, final ZookeeperCon IClient result = null; try { // TODO There is a bug when the start time is very short, and I haven't found the reason yet - // result = clientFactory.start(zkConfig.getMaxSleepTimeMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS); + // result = clientFactory.start(zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS); result = clientFactory.start(); - if (!result.blockUntilConnected(zkConfig.getMaxSleepTimeMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS)) { + if (!result.blockUntilConnected(zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS)) { result.close(); throw new KeeperException.OperationTimeoutException(); } diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java index 7e312cd88754c..8a8e6d4dc1d48 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java @@ -38,41 +38,36 @@ public final class ZookeeperConfiguration implements RegistryCenterConfiguration private String serverLists; /** - * Namespace of zookeeper. + * Namespace of registry center. */ private String namespace; /** - * Base sleep time milliseconds. + * Digest for registry center. + * + *

Default is not need digest.

*/ - private int baseSleepTimeMilliseconds = 1000; + private String digest; /** - * Max sleep time milliseconds. + * Operation timeout time in milliseconds. */ - private int maxSleepTimeMilliseconds = 3000; + private int operationTimeoutMilliseconds; /** - * Max retries. + * Max number of times to retry. */ private int maxRetries = 3; /** - * Session timeout milliseconds. + * Time interval in milliseconds on each retry. */ - private int sessionTimeoutMilliseconds; + private int retryIntervalMilliseconds = 1000; /** - * Connection timeout milliseconds. + * Time to live in seconds of ephemeral keys. */ - private int connectionTimeoutMilliseconds; - - /** - * Digest for zookeeper. - * - *

Default is not need digest

- */ - private String digest; + private int timeToLiveSeconds = 60; /** * RegCenter for zookeeper. diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java index 8f1c2590b69ec..9f369b369799e 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java @@ -65,13 +65,13 @@ public ZookeeperRegistryCenter(final ZookeeperConfiguration zkConfig) { private CuratorFramework buildCuratorClient(final ZookeeperConfiguration zkConfig) { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder() .connectString(zkConfig.getServerLists()) - .retryPolicy(new ExponentialBackoffRetry(zkConfig.getBaseSleepTimeMilliseconds(), zkConfig.getMaxRetries(), zkConfig.getMaxSleepTimeMilliseconds())) + .retryPolicy(new ExponentialBackoffRetry(zkConfig.getRetryIntervalMilliseconds(), zkConfig.getMaxRetries(), zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries())) .namespace(zkConfig.getNamespace()); - if (0 != zkConfig.getSessionTimeoutMilliseconds()) { - builder.sessionTimeoutMs(zkConfig.getSessionTimeoutMilliseconds()); + if (0 != zkConfig.getTimeToLiveSeconds()) { + builder.sessionTimeoutMs(zkConfig.getTimeToLiveSeconds() * 1000); } - if (0 != zkConfig.getConnectionTimeoutMilliseconds()) { - builder.connectionTimeoutMs(zkConfig.getConnectionTimeoutMilliseconds()); + if (0 != zkConfig.getOperationTimeoutMilliseconds()) { + builder.connectionTimeoutMs(zkConfig.getOperationTimeoutMilliseconds()); } if (!Strings.isNullOrEmpty(zkConfig.getDigest())) { builder.authorization("digest", zkConfig.getDigest().getBytes(Charsets.UTF_8)) @@ -94,7 +94,7 @@ public List getAclForPath(final String path) { private void initCuratorClient(final ZookeeperConfiguration zkConfig) { client.start(); try { - if (!client.blockUntilConnected(zkConfig.getMaxSleepTimeMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS)) { + if (!client.blockUntilConnected(zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS)) { client.close(); throw new OperationTimeoutException(); } From dd4565fd71cebe444c57a8030395f68dc232bc5c Mon Sep 17 00:00:00 2001 From: terrymanu Date: Wed, 17 Oct 2018 14:36:32 +0800 Subject: [PATCH 22/30] for #1215, abstract RegistryCenterConfiguration --- .../reg/api/RegistryCenterConfiguration.java | 49 +++++++++++++++++++ .../reg/etcd/EtcdConfiguration.java | 24 +++++---- .../reg/zookeeper/ZookeeperConfiguration.java | 21 +------- 3 files changed, 62 insertions(+), 32 deletions(-) diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java index d6e0f20f1ffe3..22d901cb8b6d3 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java @@ -23,4 +23,53 @@ * @author zhangliang */ public interface RegistryCenterConfiguration { + + /** + * Get server list of registry center. + * + * @return server list of registry center + */ + String getServerLists(); + + /** + * Get namespace of registry center. + * + * @return namespace of registry center + */ + String getNamespace(); + + /** + * Get digest of registry center. + * + * @return digest of registry center + */ + String getDigest(); + + /** + * Get operation timeout time in milliseconds. + * + * @return operation timeout time in milliseconds + */ + int getOperationTimeoutMilliseconds(); + + /** + * Get max number of times to retry. + * + * @return max number of times to retry + */ + int getMaxRetries(); + + /** + * Get time interval in milliseconds on each retry. + * + * @return time interval in milliseconds on each retry + */ + int getRetryIntervalMilliseconds(); + + /** + * Get time to live in seconds of ephemeral keys. + * + * @return time to live in seconds of ephemeral keys + */ + int getTimeToLiveSeconds(); } diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java index 74752b3c2e6ed..aae574da7bb97 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java @@ -22,7 +22,7 @@ import lombok.Setter; /** - * Etcd configuration. + * Registry center configuration for etcd. * * @author junxiong */ @@ -37,23 +37,21 @@ public final class EtcdConfiguration implements RegistryCenterConfiguration { */ private String serverLists; - /** - * Operation timeout time in milliseconds. - */ private int operationTimeoutMilliseconds = 500; - /** - * Max number of times to retry. - */ private int maxRetries = 3; - /** - * Time interval in milliseconds on each retry. - */ private int retryIntervalMilliseconds = 200; - /** - * Time to live in seconds of ephemeral keys. - */ private int timeToLiveSeconds = 60; + + @Override + public String getNamespace() { + throw new UnsupportedOperationException("Cannot support namespace on ETCD"); + } + + @Override + public String getDigest() { + throw new UnsupportedOperationException("Cannot support digest on ETCD"); + } } diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java index 8a8e6d4dc1d48..cdb4097e993b9 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java @@ -22,7 +22,7 @@ import lombok.Setter; /** - * Zookeeper based registry center configuration. + * Registry center configuration for zookeeper. * * @author zhangliang */ @@ -37,36 +37,19 @@ public final class ZookeeperConfiguration implements RegistryCenterConfiguration */ private String serverLists; - /** - * Namespace of registry center. - */ private String namespace; /** - * Digest for registry center. - * - *

Default is not need digest.

+ * Default is not need digest. */ private String digest; - /** - * Operation timeout time in milliseconds. - */ private int operationTimeoutMilliseconds; - /** - * Max number of times to retry. - */ private int maxRetries = 3; - /** - * Time interval in milliseconds on each retry. - */ private int retryIntervalMilliseconds = 1000; - /** - * Time to live in seconds of ephemeral keys. - */ private int timeToLiveSeconds = 60; /** From 6dc77907d4d791b0a453f756aab19e88c3cfb578 Mon Sep 17 00:00:00 2001 From: terrymanu Date: Wed, 17 Oct 2018 15:41:21 +0800 Subject: [PATCH 23/30] for #1215, split orche to multiple modules --- ...itional-spring-configuration-metadata.json | 18 +++---- .../parser/RegBeanDefinitionParser.java | 4 +- .../sharding-jdbc-orchestration/pom.xml | 20 +++++++ .../sharding-orchestration-core/pom.xml | 17 +++++- .../internal/OrchestrationFacade.java | 18 +++---- .../yaml/YamlOrchestrationConfiguration.java | 4 +- .../sharding-orchestration-reg/pom.xml | 8 +++ .../sharding-orchestration-reg-api/pom.xml | 12 +++++ .../orchestration/reg/api/RegistryCenter.java | 0 .../reg/api/RegistryCenterConfiguration.java | 0 .../reg/exception/RegException.java | 0 .../reg/exception/RegExceptionHandler.java | 0 .../reg/listener/DataChangedEvent.java | 0 .../reg/listener/EventListener.java | 0 .../sharding-orchestration-reg-etcd/pom.xml | 20 +++++++ .../reg/etcd/EtcdConfiguration.java | 0 .../reg/etcd/EtcdRegistryCenter.java | 0 .../internal/channel/EtcdChannelFactory.java | 0 .../channel/EtcdNameSolverFactory.java | 0 .../etcd/internal/keepalive/KeepAlive.java | 0 .../etcd/internal/retry/EtcdRetryEngine.java | 0 .../watcher/EtcdWatchStreamObserver.java | 0 .../main/proto/etcd/auth/authpb/auth.proto | 0 .../etcd/etcdserver/etcdserverpb/rpc.proto | 0 .../src/main/proto/etcd/mvcc/mvccpb/kv.proto | 0 .../pom.xml | 20 +++++++ .../newzk/NativeZookeeperConfiguration.java | 54 +++++++++++++++++++ .../reg/newzk/NewZookeeperRegistryCenter.java | 9 ++-- .../client/action/ContentionCallback.java | 0 .../reg/newzk/client/action/IAction.java | 0 .../reg/newzk/client/action/IClient.java | 0 .../newzk/client/action/IExecStrategy.java | 0 .../reg/newzk/client/action/IGroupAction.java | 0 .../reg/newzk/client/action/IProvider.java | 0 .../client/action/ITransactionProvider.java | 0 .../reg/newzk/client/cache/CacheStrategy.java | 0 .../reg/newzk/client/cache/PathNode.java | 0 .../reg/newzk/client/cache/PathResolve.java | 0 .../reg/newzk/client/cache/PathStatus.java | 0 .../reg/newzk/client/cache/PathTree.java | 0 .../newzk/client/election/LeaderElection.java | 0 .../newzk/client/retry/AsyncRetryCenter.java | 0 .../client/retry/DelayPolicyExecutor.java | 0 .../newzk/client/retry/DelayRetryPolicy.java | 0 .../reg/newzk/client/retry/RetryCallable.java | 0 .../client/retry/RetryResultCallable.java | 0 .../reg/newzk/client/retry/RetryThread.java | 0 .../reg/newzk/client/utility/PathUtil.java | 0 .../client/utility/ZookeeperConstants.java | 0 .../newzk/client/zookeeper/CacheClient.java | 0 .../newzk/client/zookeeper/ClientFactory.java | 0 .../newzk/client/zookeeper/UsualClient.java | 0 .../client/zookeeper/base/BaseClient.java | 0 .../zookeeper/base/BaseClientFactory.java | 0 .../client/zookeeper/base/BaseContext.java | 0 .../client/zookeeper/base/BaseOperation.java | 0 .../newzk/client/zookeeper/base/Holder.java | 0 .../operation/CreateAllNeedOperation.java | 0 .../operation/CreateCurrentOperation.java | 0 .../operation/DeleteAllChildrenOperation.java | 0 .../DeleteCurrentBranchOperation.java | 0 .../operation/DeleteCurrentOperation.java | 0 .../zookeeper/operation/UpdateOperation.java | 0 .../zookeeper/provider/BaseProvider.java | 0 .../provider/TransactionProvider.java | 0 .../zookeeper/section/ClientContext.java | 0 .../client/zookeeper/section/ClientTask.java | 0 .../client/zookeeper/section/Connection.java | 0 .../zookeeper/section/StrategyType.java | 0 .../zookeeper/section/WatcherCreator.java | 0 .../section/ZookeeperEventListener.java | 0 .../strategy/AsyncRetryStrategy.java | 0 .../zookeeper/strategy/BaseStrategy.java | 0 .../strategy/ContentionStrategy.java | 0 .../zookeeper/strategy/SyncRetryStrategy.java | 0 .../strategy/TransactionContendStrategy.java | 0 .../zookeeper/strategy/UsualStrategy.java | 0 .../transaction/BaseTransaction.java | 0 .../transaction/ZooKeeperTransaction.java | 0 .../reg/newzk/AllNewzkTests.java | 0 .../newzk/client/cache/PathResolveTest.java | 0 .../reg/newzk/client/cache/PathTreeTest.java | 0 .../reg/newzk/client/retry/TestCallable.java | 0 .../client/retry/TestResultCallable.java | 0 .../newzk/client/util/EmbedTestingServer.java | 0 .../newzk/client/zookeeper/AllBaseTests.java | 0 .../zookeeper/SyncRetryStrategyTest.java | 0 .../client/zookeeper/UsualClientTest.java | 0 .../client/zookeeper/base/BaseClientTest.java | 0 .../newzk/client/zookeeper/base/BaseTest.java | 0 .../client/zookeeper/base/StartWaitTest.java | 2 +- .../client/zookeeper/base/TestClient.java | 0 .../client/zookeeper/base/TestHolder.java | 0 .../client/zookeeper/base/TestSupport.java | 0 .../src/test/resources/logback-test.xml | 0 .../pom.xml | 20 +++++++ .../CuratorZookeeperConfiguration.java} | 11 +--- .../zookeeper/ZookeeperRegistryCenter.java | 8 +-- .../orchestration/AllTests.java | 28 ---------- .../orchestration/reg/AllRegTests.java | 28 ---------- 100 files changed, 201 insertions(+), 100 deletions(-) create mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/pom.xml rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-api}/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenter.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-api}/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-api}/src/main/java/io/shardingsphere/orchestration/reg/exception/RegException.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-api}/src/main/java/io/shardingsphere/orchestration/reg/exception/RegExceptionHandler.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-api}/src/main/java/io/shardingsphere/orchestration/reg/listener/DataChangedEvent.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-api}/src/main/java/io/shardingsphere/orchestration/reg/listener/EventListener.java (100%) create mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdChannelFactory.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdNameSolverFactory.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/keepalive/KeepAlive.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/watcher/EtcdWatchStreamObserver.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/proto/etcd/auth/authpb/auth.proto (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/proto/etcd/etcdserver/etcdserverpb/rpc.proto (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-etcd}/src/main/proto/etcd/mvcc/mvccpb/kv.proto (100%) create mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml create mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NativeZookeeperConfiguration.java rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java (96%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ContentionCallback.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IAction.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IClient.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IExecStrategy.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IGroupAction.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IProvider.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ITransactionProvider.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/CacheStrategy.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathNode.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolve.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathStatus.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTree.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/election/LeaderElection.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/AsyncRetryCenter.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayPolicyExecutor.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayRetryPolicy.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryCallable.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryResultCallable.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryThread.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/PathUtil.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/ZookeeperConstants.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/CacheClient.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/ClientFactory.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClient.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClient.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientFactory.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseContext.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/Holder.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateAllNeedOperation.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateCurrentOperation.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteAllChildrenOperation.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentBranchOperation.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentOperation.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/UpdateOperation.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/BaseProvider.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/TransactionProvider.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientContext.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientTask.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/Connection.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/StrategyType.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/WatcherCreator.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ZookeeperEventListener.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/AsyncRetryStrategy.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/BaseStrategy.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/ContentionStrategy.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/SyncRetryStrategy.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/TransactionContendStrategy.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/UsualStrategy.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/BaseTransaction.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/ZooKeeperTransaction.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/AllNewzkTests.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolveTest.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTreeTest.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestCallable.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestResultCallable.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/util/EmbedTestingServer.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/AllBaseTests.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/SyncRetryStrategyTest.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClientTest.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientTest.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseTest.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestClient.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestHolder.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestSupport.java (100%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-native-zookeeper}/src/test/resources/logback-test.xml (100%) create mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml rename sharding-orchestration/sharding-orchestration-reg/{src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java => sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/CuratorZookeeperConfiguration.java} (83%) rename sharding-orchestration/sharding-orchestration-reg/{ => sharding-orchestration-reg-zookeeper-curator}/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java (97%) delete mode 100644 sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/AllTests.java delete mode 100644 sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/AllRegTests.java diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 4f3b123468199..30436094e8c65 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -10,9 +10,9 @@ "type": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", "name": "sharding.jdbc.config.orchestration.zookeeper", - "type": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration" + "type": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration" }, { "sourceType": "io.shardingsphere.core.yaml.sharding.YamlShardingStrategyConfiguration", @@ -111,46 +111,46 @@ "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", "name": "sharding.jdbc.config.orchestration.zookeeper.server-lists", "description": "Zookeeper server list.\n \n

Include ip address and port, multiple servers split by comma. Etc: {@code host1:2181,host2:2181}<\/p>.", "type": "java.lang.String" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", "name": "sharding.jdbc.config.orchestration.zookeeper.namespace", "description": "Namespace of registry center.", "type": "java.lang.String" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", "name": "sharding.jdbc.config.orchestration.zookeeper.digest", "description": "Digest for registry center.\n \n

Default is not need digest<\/p>.", "type": "java.lang.String" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", "defaultValue": 0, "name": "sharding.jdbc.config.orchestration.zookeeper.operation-timeout-milliseconds", "description": "Operation timeout time in milliseconds.", "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", "defaultValue": 3, "name": "sharding.jdbc.config.orchestration.zookeeper.max-retries", "description": "Max number of times to retry.", "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", "defaultValue": 1000, "name": "sharding.jdbc.config.orchestration.zookeeper.retry-interval-milliseconds", "description": "Time interval in milliseconds on each retry.", "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", "defaultValue": 0, "name": "sharding.jdbc.config.orchestration.zookeeper.time-to-live-seconds", "description": "Time to live in seconds of ephemeral keys.", diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java index cbca58264508c..7c60d4429b983 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; -import io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration; +import io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration; import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.EtcdRegistryCenterBeanDefinitionParserTag; import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.ZookeeperRegistryCenterBeanDefinitionParserTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; @@ -41,7 +41,7 @@ protected AbstractBeanDefinition parseInternal(final Element element, final Pars } private AbstractBeanDefinition getZookeeperConfiguration(final Element element) { - BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(ZookeeperConfiguration.class); + BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(CuratorZookeeperConfiguration.class); addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.SERVER_LISTS_TAG, "serverLists", element, factory); addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.NAMESPACE_TAG, "namespace", element, factory); addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.DIGEST_TAG, "digest", element, factory); diff --git a/sharding-jdbc/sharding-jdbc-orchestration/pom.xml b/sharding-jdbc/sharding-jdbc-orchestration/pom.xml index b80a1c72e0dec..5766c5490e216 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/pom.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration/pom.xml @@ -21,6 +21,26 @@ sharding-orchestration-core ${project.version} + + io.shardingsphere + sharding-orchestration-reg-zookeeper-curator + ${project.version} + + + io.shardingsphere + sharding-orchestration-reg-native-zookeeper + ${project.version} + + + io.shardingsphere + sharding-orchestration-reg-etcd + ${project.version} + + + io.shardingsphere + sharding-core + ${project.version} + org.apache.curator diff --git a/sharding-orchestration/sharding-orchestration-core/pom.xml b/sharding-orchestration/sharding-orchestration-core/pom.xml index 8fbed546c60a6..679597d763014 100644 --- a/sharding-orchestration/sharding-orchestration-core/pom.xml +++ b/sharding-orchestration/sharding-orchestration-core/pom.xml @@ -13,7 +13,22 @@ io.shardingsphere - sharding-orchestration-reg + sharding-orchestration-reg-api + ${project.version} + + + io.shardingsphere + sharding-orchestration-reg-zookeeper-curator + ${project.version} + + + io.shardingsphere + sharding-orchestration-reg-native-zookeeper + ${project.version} + + + io.shardingsphere + sharding-orchestration-reg-etcd ${project.version} diff --git a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java index b6b502aec3b43..6d9a30329140e 100644 --- a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java +++ b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java @@ -32,8 +32,9 @@ import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; import io.shardingsphere.orchestration.reg.etcd.EtcdRegistryCenter; +import io.shardingsphere.orchestration.reg.newzk.NativeZookeeperConfiguration; import io.shardingsphere.orchestration.reg.newzk.NewZookeeperRegistryCenter; -import io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration; +import io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration; import io.shardingsphere.orchestration.reg.zookeeper.ZookeeperRegistryCenter; import io.shardingsphere.shardingjdbc.jdbc.core.datasource.MasterSlaveDataSource; import lombok.Getter; @@ -79,8 +80,11 @@ public OrchestrationFacade(final OrchestrationConfiguration orchestrationConfig) private RegistryCenter createRegistryCenter(final RegistryCenterConfiguration regCenterConfig) { Preconditions.checkNotNull(regCenterConfig, "Registry center configuration cannot be null."); - if (regCenterConfig instanceof ZookeeperConfiguration) { - return getZookeeperRegistryCenter((ZookeeperConfiguration) regCenterConfig); + if (regCenterConfig instanceof CuratorZookeeperConfiguration) { + return new ZookeeperRegistryCenter((CuratorZookeeperConfiguration) regCenterConfig); + } + if (regCenterConfig instanceof NativeZookeeperConfiguration) { + return new NewZookeeperRegistryCenter((NativeZookeeperConfiguration) regCenterConfig); } if (regCenterConfig instanceof EtcdConfiguration) { return new EtcdRegistryCenter((EtcdConfiguration) regCenterConfig); @@ -88,14 +92,6 @@ private RegistryCenter createRegistryCenter(final RegistryCenterConfiguration re throw new UnsupportedOperationException(regCenterConfig.getClass().getName()); } - private RegistryCenter getZookeeperRegistryCenter(final ZookeeperConfiguration regCenterConfig) { - if (regCenterConfig.isUseNative()) { - return new NewZookeeperRegistryCenter(regCenterConfig); - } else { - return new ZookeeperRegistryCenter(regCenterConfig); - } - } - /** * Initialize for sharding orchestration. * diff --git a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java index 670ad603e1c12..053eb21fb8a99 100644 --- a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java @@ -20,7 +20,7 @@ import com.google.common.base.Preconditions; import io.shardingsphere.orchestration.config.OrchestrationConfiguration; import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; -import io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration; +import io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration; import lombok.Getter; import lombok.Setter; @@ -38,7 +38,7 @@ public class YamlOrchestrationConfiguration { private EtcdConfiguration etcd; - private ZookeeperConfiguration zookeeper; + private CuratorZookeeperConfiguration zookeeper; private boolean overwrite; diff --git a/sharding-orchestration/sharding-orchestration-reg/pom.xml b/sharding-orchestration/sharding-orchestration-reg/pom.xml index 78e0b91725c07..ccecfe1521132 100644 --- a/sharding-orchestration/sharding-orchestration-reg/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/pom.xml @@ -9,6 +9,14 @@ 4.0.0 sharding-orchestration-reg + pom + + + sharding-orchestration-reg-api + sharding-orchestration-reg-zookeeper-curator + sharding-orchestration-reg-native-zookeeper + sharding-orchestration-reg-etcd + diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/pom.xml new file mode 100644 index 0000000000000..ae4de19bf03cf --- /dev/null +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/pom.xml @@ -0,0 +1,12 @@ + + + 4.0.0 + + sharding-orchestration-reg + io.shardingsphere + 3.0.0.M5-SNAPSHOT + + sharding-orchestration-reg-api + diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenter.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenter.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenter.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/exception/RegException.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegException.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/exception/RegException.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegException.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/exception/RegExceptionHandler.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegExceptionHandler.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/exception/RegExceptionHandler.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegExceptionHandler.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/listener/DataChangedEvent.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/listener/DataChangedEvent.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/listener/DataChangedEvent.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/listener/DataChangedEvent.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/listener/EventListener.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/listener/EventListener.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/listener/EventListener.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/listener/EventListener.java diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml new file mode 100644 index 0000000000000..ab21e5a45c83f --- /dev/null +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + sharding-orchestration-reg + io.shardingsphere + 3.0.0.M5-SNAPSHOT + + sharding-orchestration-reg-etcd + + + + io.shardingsphere + sharding-orchestration-reg-api + ${project.version} + + + diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdChannelFactory.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdChannelFactory.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdChannelFactory.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdChannelFactory.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdNameSolverFactory.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdNameSolverFactory.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdNameSolverFactory.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/channel/EtcdNameSolverFactory.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/keepalive/KeepAlive.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/keepalive/KeepAlive.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/keepalive/KeepAlive.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/keepalive/KeepAlive.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/watcher/EtcdWatchStreamObserver.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/watcher/EtcdWatchStreamObserver.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/watcher/EtcdWatchStreamObserver.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/watcher/EtcdWatchStreamObserver.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/proto/etcd/auth/authpb/auth.proto b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/proto/etcd/auth/authpb/auth.proto similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/proto/etcd/auth/authpb/auth.proto rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/proto/etcd/auth/authpb/auth.proto diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/proto/etcd/etcdserver/etcdserverpb/rpc.proto b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/proto/etcd/etcdserver/etcdserverpb/rpc.proto similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/proto/etcd/etcdserver/etcdserverpb/rpc.proto rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/proto/etcd/etcdserver/etcdserverpb/rpc.proto diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/proto/etcd/mvcc/mvccpb/kv.proto b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/proto/etcd/mvcc/mvccpb/kv.proto similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/proto/etcd/mvcc/mvccpb/kv.proto rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/proto/etcd/mvcc/mvccpb/kv.proto diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml new file mode 100644 index 0000000000000..a57e6b54cc6ef --- /dev/null +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + sharding-orchestration-reg + io.shardingsphere + 3.0.0.M5-SNAPSHOT + + sharding-orchestration-reg-native-zookeeper + + + + io.shardingsphere + sharding-orchestration-reg-api + ${project.version} + + + diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NativeZookeeperConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NativeZookeeperConfiguration.java new file mode 100644 index 0000000000000..140d006b733fc --- /dev/null +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NativeZookeeperConfiguration.java @@ -0,0 +1,54 @@ +/* + * Copyright 2016-2018 shardingsphere.io. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *

+ */ + +package io.shardingsphere.orchestration.reg.newzk; + +import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; +import lombok.Getter; +import lombok.Setter; + +/** + * Registry center configuration for native zookeeper. + * + * @author zhangliang + */ +@Getter +@Setter +public final class NativeZookeeperConfiguration implements RegistryCenterConfiguration { + + /** + * Zookeeper server list. + * + *

Include ip address and port, multiple servers split by comma. Etc: {@code host1:2181,host2:2181}

+ */ + private String serverLists; + + private String namespace; + + /** + * Default is not need digest. + */ + private String digest; + + private int operationTimeoutMilliseconds; + + private int maxRetries = 3; + + private int retryIntervalMilliseconds = 1000; + + private int timeToLiveSeconds = 60; +} diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java similarity index 96% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java index 693a1aceb06f9..4c37d18e45183 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java @@ -31,7 +31,6 @@ import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.ClientFactory; import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.StrategyType; import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; -import io.shardingsphere.orchestration.reg.zookeeper.ZookeeperConfiguration; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; @@ -47,7 +46,7 @@ import java.util.concurrent.TimeUnit; /** - * Zookeeper native based registry center. + * Registry center for native zookeeper. * * @author lidongbo */ @@ -57,12 +56,12 @@ public final class NewZookeeperRegistryCenter implements RegistryCenter { private final Map caches; - public NewZookeeperRegistryCenter(final ZookeeperConfiguration zkConfig) { + public NewZookeeperRegistryCenter(final NativeZookeeperConfiguration zkConfig) { client = initClient(buildClientFactory(zkConfig), zkConfig); caches = new HashMap<>(); } - private ClientFactory buildClientFactory(final ZookeeperConfiguration zkConfig) { + private ClientFactory buildClientFactory(final NativeZookeeperConfiguration zkConfig) { ClientFactory result = new ClientFactory(); result.setClientNamespace(zkConfig.getNamespace()).newClient(zkConfig.getServerLists(), zkConfig.getTimeToLiveSeconds() * 1000) .setRetryPolicy(new DelayRetryPolicy(zkConfig.getRetryIntervalMilliseconds(), zkConfig.getMaxRetries(), zkConfig.getRetryIntervalMilliseconds())); @@ -72,7 +71,7 @@ private ClientFactory buildClientFactory(final ZookeeperConfiguration zkConfig) return result; } - private IClient initClient(final ClientFactory clientFactory, final ZookeeperConfiguration zkConfig) { + private IClient initClient(final ClientFactory clientFactory, final NativeZookeeperConfiguration zkConfig) { IClient result = null; try { // TODO There is a bug when the start time is very short, and I haven't found the reason yet diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ContentionCallback.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ContentionCallback.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ContentionCallback.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ContentionCallback.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IAction.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IAction.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IAction.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IAction.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IClient.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IClient.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IExecStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IExecStrategy.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IExecStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IExecStrategy.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IGroupAction.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IGroupAction.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IGroupAction.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IGroupAction.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IProvider.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IProvider.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IProvider.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IProvider.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ITransactionProvider.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ITransactionProvider.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ITransactionProvider.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ITransactionProvider.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/CacheStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/CacheStrategy.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/CacheStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/CacheStrategy.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathNode.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathNode.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathNode.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathNode.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolve.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolve.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolve.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolve.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathStatus.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathStatus.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathStatus.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathStatus.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTree.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTree.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTree.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTree.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/election/LeaderElection.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/election/LeaderElection.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/election/LeaderElection.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/election/LeaderElection.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/AsyncRetryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/AsyncRetryCenter.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/AsyncRetryCenter.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/AsyncRetryCenter.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayPolicyExecutor.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayPolicyExecutor.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayPolicyExecutor.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayPolicyExecutor.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayRetryPolicy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayRetryPolicy.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayRetryPolicy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayRetryPolicy.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryCallable.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryCallable.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryCallable.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryCallable.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryResultCallable.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryResultCallable.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryResultCallable.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryResultCallable.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryThread.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryThread.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryThread.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryThread.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/PathUtil.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/PathUtil.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/PathUtil.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/PathUtil.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/ZookeeperConstants.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/ZookeeperConstants.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/ZookeeperConstants.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/ZookeeperConstants.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/CacheClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/CacheClient.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/CacheClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/CacheClient.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/ClientFactory.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/ClientFactory.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/ClientFactory.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/ClientFactory.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClient.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClient.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClient.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClient.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientFactory.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientFactory.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientFactory.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientFactory.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseContext.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseContext.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseContext.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseContext.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/Holder.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/Holder.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/Holder.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/Holder.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateAllNeedOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateAllNeedOperation.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateAllNeedOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateAllNeedOperation.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateCurrentOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateCurrentOperation.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateCurrentOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateCurrentOperation.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteAllChildrenOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteAllChildrenOperation.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteAllChildrenOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteAllChildrenOperation.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentBranchOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentBranchOperation.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentBranchOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentBranchOperation.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentOperation.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentOperation.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/UpdateOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/UpdateOperation.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/UpdateOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/UpdateOperation.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/BaseProvider.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/BaseProvider.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/BaseProvider.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/BaseProvider.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/TransactionProvider.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/TransactionProvider.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/TransactionProvider.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/TransactionProvider.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientContext.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientContext.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientContext.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientContext.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientTask.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientTask.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientTask.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientTask.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/Connection.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/Connection.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/Connection.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/Connection.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/StrategyType.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/StrategyType.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/StrategyType.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/StrategyType.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/WatcherCreator.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/WatcherCreator.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/WatcherCreator.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/WatcherCreator.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ZookeeperEventListener.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ZookeeperEventListener.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ZookeeperEventListener.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ZookeeperEventListener.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/AsyncRetryStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/AsyncRetryStrategy.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/AsyncRetryStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/AsyncRetryStrategy.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/BaseStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/BaseStrategy.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/BaseStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/BaseStrategy.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/ContentionStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/ContentionStrategy.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/ContentionStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/ContentionStrategy.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/SyncRetryStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/SyncRetryStrategy.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/SyncRetryStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/SyncRetryStrategy.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/TransactionContendStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/TransactionContendStrategy.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/TransactionContendStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/TransactionContendStrategy.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/UsualStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/UsualStrategy.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/UsualStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/UsualStrategy.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/BaseTransaction.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/BaseTransaction.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/BaseTransaction.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/BaseTransaction.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/ZooKeeperTransaction.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/ZooKeeperTransaction.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/ZooKeeperTransaction.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/ZooKeeperTransaction.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/AllNewzkTests.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/AllNewzkTests.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/AllNewzkTests.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/AllNewzkTests.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolveTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolveTest.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolveTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolveTest.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTreeTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTreeTest.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTreeTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTreeTest.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestCallable.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestCallable.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestCallable.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestCallable.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestResultCallable.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestResultCallable.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestResultCallable.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestResultCallable.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/util/EmbedTestingServer.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/util/EmbedTestingServer.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/util/EmbedTestingServer.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/util/EmbedTestingServer.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/AllBaseTests.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/AllBaseTests.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/AllBaseTests.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/AllBaseTests.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/SyncRetryStrategyTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/SyncRetryStrategyTest.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/SyncRetryStrategyTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/SyncRetryStrategyTest.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClientTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClientTest.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClientTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClientTest.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientTest.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientTest.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseTest.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseTest.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java index f1387b222b553..3593ad1af6f43 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java @@ -17,9 +17,9 @@ package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ClientContext; import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; import io.shardingsphere.orchestration.reg.newzk.client.util.EmbedTestingServer; +import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ClientContext; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestClient.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestClient.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestHolder.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestHolder.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestHolder.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestHolder.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestSupport.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestSupport.java similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestSupport.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestSupport.java diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/resources/logback-test.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/resources/logback-test.xml similarity index 100% rename from sharding-orchestration/sharding-orchestration-reg/src/test/resources/logback-test.xml rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/resources/logback-test.xml diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml new file mode 100644 index 0000000000000..8e5dffe4e53da --- /dev/null +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + sharding-orchestration-reg + io.shardingsphere + 3.0.0.M5-SNAPSHOT + + sharding-orchestration-reg-zookeeper-curator + + + + io.shardingsphere + sharding-orchestration-reg-api + ${project.version} + + + diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/CuratorZookeeperConfiguration.java similarity index 83% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/CuratorZookeeperConfiguration.java index cdb4097e993b9..d1cd3bc2b0495 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/CuratorZookeeperConfiguration.java @@ -22,13 +22,13 @@ import lombok.Setter; /** - * Registry center configuration for zookeeper. + * Registry center configuration for zookeeper with curator. * * @author zhangliang */ @Getter @Setter -public final class ZookeeperConfiguration implements RegistryCenterConfiguration { +public final class CuratorZookeeperConfiguration implements RegistryCenterConfiguration { /** * Zookeeper server list. @@ -51,11 +51,4 @@ public final class ZookeeperConfiguration implements RegistryCenterConfiguration private int retryIntervalMilliseconds = 1000; private int timeToLiveSeconds = 60; - - /** - * RegCenter for zookeeper. - * - *

Default is ZookeeperRegistryCenter

- */ - private boolean useNative; } diff --git a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java similarity index 97% rename from sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java index 9f369b369799e..d2c83f0b52d05 100644 --- a/sharding-orchestration/sharding-orchestration-reg/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java @@ -47,7 +47,7 @@ import java.util.concurrent.TimeUnit; /** - * Zookeeper based registry center. + * Registry center for zookeeper with curator. * * @author zhangliang */ @@ -57,12 +57,12 @@ public final class ZookeeperRegistryCenter implements RegistryCenter { private final Map caches = new HashMap<>(); - public ZookeeperRegistryCenter(final ZookeeperConfiguration zkConfig) { + public ZookeeperRegistryCenter(final CuratorZookeeperConfiguration zkConfig) { client = buildCuratorClient(zkConfig); initCuratorClient(zkConfig); } - private CuratorFramework buildCuratorClient(final ZookeeperConfiguration zkConfig) { + private CuratorFramework buildCuratorClient(final CuratorZookeeperConfiguration zkConfig) { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder() .connectString(zkConfig.getServerLists()) .retryPolicy(new ExponentialBackoffRetry(zkConfig.getRetryIntervalMilliseconds(), zkConfig.getMaxRetries(), zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries())) @@ -91,7 +91,7 @@ public List getAclForPath(final String path) { return builder.build(); } - private void initCuratorClient(final ZookeeperConfiguration zkConfig) { + private void initCuratorClient(final CuratorZookeeperConfiguration zkConfig) { client.start(); try { if (!client.blockUntilConnected(zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS)) { diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/AllTests.java b/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/AllTests.java deleted file mode 100644 index 3caa14bd21de1..0000000000000 --- a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/AllTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2016-2018 shardingsphere.io. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *

- */ - -package io.shardingsphere.orchestration; - -import io.shardingsphere.orchestration.reg.AllRegTests; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(Suite.class) -@SuiteClasses(AllRegTests.class) -public final class AllTests { -} diff --git a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/AllRegTests.java b/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/AllRegTests.java deleted file mode 100644 index dbe89af06ee73..0000000000000 --- a/sharding-orchestration/sharding-orchestration-reg/src/test/java/io/shardingsphere/orchestration/reg/AllRegTests.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2016-2018 shardingsphere.io. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *

- */ - -package io.shardingsphere.orchestration.reg; - -import io.shardingsphere.orchestration.reg.newzk.AllNewzkTests; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(Suite.class) -@SuiteClasses(AllNewzkTests.class) -public final class AllRegTests { -} From 0897843b6d18f88bb67cb340ca51135cb73d6b78 Mon Sep 17 00:00:00 2001 From: terrymanu Date: Wed, 17 Oct 2018 16:10:22 +0800 Subject: [PATCH 24/30] for #1215, move package newzk to zookeeper.natived --- ...itional-spring-configuration-metadata.json | 18 +++--- .../spring/boot/util/EmbedTestingServer.java | 6 +- .../parser/RegBeanDefinitionParser.java | 2 +- .../spring/util/EmbedTestingServer.java | 6 +- .../api/yaml/util/EmbedTestingServer.java | 6 +- .../internal/OrchestrationFacade.java | 12 ++-- .../yaml/YamlOrchestrationConfiguration.java | 2 +- ...tion.java => RegistryCenterException.java} | 6 +- .../reg/etcd/EtcdRegistryCenter.java | 4 +- .../etcd/internal/retry/EtcdRetryEngine.java | 5 +- .../watcher/EtcdWatchStreamObserver.java | 4 +- .../NativeZookeeperConfiguration.java | 2 +- .../NativeZookeeperExceptionHandler.java} | 11 ++-- .../NativeZookeeperRegistryCenter.java} | 49 ++++++++------- .../client/action/ContentionCallback.java | 2 +- .../natived}/client/action/IAction.java | 2 +- .../natived}/client/action/IClient.java | 8 +-- .../natived}/client/action/IExecStrategy.java | 4 +- .../natived}/client/action/IGroupAction.java | 2 +- .../natived}/client/action/IProvider.java | 6 +- .../client/action/ITransactionProvider.java | 4 +- .../natived}/client/cache/CacheStrategy.java | 2 +- .../natived}/client/cache/PathNode.java | 6 +- .../natived}/client/cache/PathResolve.java | 2 +- .../natived}/client/cache/PathStatus.java | 2 +- .../natived}/client/cache/PathTree.java | 12 ++-- .../client/election/LeaderElection.java | 12 ++-- .../client/retry/AsyncRetryCenter.java | 4 +- .../client/retry/DelayPolicyExecutor.java | 2 +- .../client/retry/DelayRetryPolicy.java | 2 +- .../natived}/client/retry/RetryCallable.java | 6 +- .../client/retry/RetryResultCallable.java | 4 +- .../natived}/client/retry/RetryThread.java | 4 +- .../natived}/client/utility/PathUtil.java | 2 +- .../client/utility/ZookeeperConstants.java | 2 +- .../client/zookeeper/CacheClient.java | 12 ++-- .../client/zookeeper/ClientFactory.java | 16 ++--- .../client/zookeeper/UsualClient.java | 30 +++++----- .../client/zookeeper/base/BaseClient.java | 14 ++--- .../zookeeper/base/BaseClientFactory.java | 6 +- .../client/zookeeper/base/BaseContext.java | 4 +- .../client/zookeeper/base/BaseOperation.java | 8 +-- .../client/zookeeper/base/Holder.java | 4 +- .../operation/CreateAllNeedOperation.java | 8 +-- .../operation/CreateCurrentOperation.java | 6 +- .../operation/DeleteAllChildrenOperation.java | 8 +-- .../DeleteCurrentBranchOperation.java | 8 +-- .../operation/DeleteCurrentOperation.java | 6 +- .../zookeeper/operation/UpdateOperation.java | 6 +- .../zookeeper/provider/BaseProvider.java | 14 ++--- .../provider/TransactionProvider.java | 12 ++-- .../zookeeper/section/ClientContext.java | 8 +-- .../client/zookeeper/section/ClientTask.java | 4 +- .../client/zookeeper/section/Connection.java | 2 +- .../zookeeper/section/StrategyType.java | 2 +- .../zookeeper/section/WatcherCreator.java | 2 +- .../section/ZookeeperEventListener.java | 2 +- .../strategy/AsyncRetryStrategy.java | 22 +++---- .../zookeeper/strategy/BaseStrategy.java | 8 +-- .../strategy/ContentionStrategy.java | 12 ++-- .../zookeeper/strategy/SyncRetryStrategy.java | 10 ++-- .../strategy/TransactionContendStrategy.java | 16 ++--- .../zookeeper/strategy/UsualStrategy.java | 8 +-- .../transaction/BaseTransaction.java | 2 +- .../transaction/ZooKeeperTransaction.java | 8 +-- .../natived/AllNativeZookeeperTests.java} | 14 ++--- .../client/cache/PathResolveTest.java | 2 +- .../natived}/client/cache/PathTreeTest.java | 17 +++--- .../natived}/client/retry/TestCallable.java | 6 +- .../client/retry/TestResultCallable.java | 6 +- .../client/util/EmbedTestingServer.java | 8 +-- .../client/zookeeper/AllBaseTests.java | 4 +- .../zookeeper/SyncRetryStrategyTest.java | 20 +++---- .../client/zookeeper/UsualClientTest.java | 24 ++++---- .../client/zookeeper/base/BaseClientTest.java | 14 ++--- .../client/zookeeper/base/BaseTest.java | 4 +- .../client/zookeeper/base/StartWaitTest.java | 8 +-- .../client/zookeeper/base/TestClient.java | 4 +- .../client/zookeeper/base/TestHolder.java | 2 +- .../client/zookeeper/base/TestSupport.java | 4 +- .../src/test/resources/logback-test.xml | 2 +- .../CuratorZookeeperConfiguration.java | 2 +- .../CuratorZookeeperExceptionHandler.java | 60 +++++++++++++++++++ .../CuratorZookeeperRegistryCenter.java} | 23 ++++--- 84 files changed, 387 insertions(+), 328 deletions(-) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/{RegException.java => RegistryCenterException.java} (80%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/NativeZookeeperConfiguration.java (95%) rename sharding-orchestration/sharding-orchestration-reg/{sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegExceptionHandler.java => sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperExceptionHandler.java} (84%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk/NewZookeeperRegistryCenter.java => zookeeper/natived/NativeZookeeperRegistryCenter.java} (79%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/action/ContentionCallback.java (91%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/action/IAction.java (98%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/action/IClient.java (86%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/action/IExecStrategy.java (84%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/action/IGroupAction.java (96%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/action/IProvider.java (94%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/action/ITransactionProvider.java (85%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/cache/CacheStrategy.java (90%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/cache/PathNode.java (91%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/cache/PathResolve.java (95%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/cache/PathStatus.java (90%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/cache/PathTree.java (95%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/election/LeaderElection.java (87%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/retry/AsyncRetryCenter.java (91%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/retry/DelayPolicyExecutor.java (95%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/retry/DelayRetryPolicy.java (94%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/retry/RetryCallable.java (89%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/retry/RetryResultCallable.java (89%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/retry/RetryThread.java (95%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/utility/PathUtil.java (98%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/utility/ZookeeperConstants.java (95%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/CacheClient.java (88%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/ClientFactory.java (83%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/UsualClient.java (79%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/BaseClient.java (89%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/BaseClientFactory.java (90%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/BaseContext.java (86%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/BaseOperation.java (86%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/Holder.java (96%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/operation/CreateAllNeedOperation.java (80%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/operation/CreateCurrentOperation.java (85%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/operation/DeleteAllChildrenOperation.java (77%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/operation/DeleteCurrentBranchOperation.java (77%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/operation/DeleteCurrentOperation.java (82%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/operation/UpdateOperation.java (83%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/provider/BaseProvider.java (88%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/provider/TransactionProvider.java (71%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/section/ClientContext.java (80%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/section/ClientTask.java (89%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/section/Connection.java (96%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/section/StrategyType.java (90%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/section/WatcherCreator.java (94%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/section/ZookeeperEventListener.java (93%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/strategy/AsyncRetryStrategy.java (80%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/strategy/BaseStrategy.java (76%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/strategy/ContentionStrategy.java (94%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/strategy/SyncRetryStrategy.java (93%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/strategy/TransactionContendStrategy.java (88%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/strategy/UsualStrategy.java (94%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/transaction/BaseTransaction.java (97%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/transaction/ZooKeeperTransaction.java (88%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk/AllNewzkTests.java => zookeeper/natived/AllNativeZookeeperTests.java} (61%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/cache/PathResolveTest.java (96%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/cache/PathTreeTest.java (89%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/retry/TestCallable.java (85%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/retry/TestResultCallable.java (85%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/util/EmbedTestingServer.java (84%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/AllBaseTests.java (82%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/SyncRetryStrategyTest.java (91%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/UsualClientTest.java (82%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/BaseClientTest.java (95%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/BaseTest.java (87%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/StartWaitTest.java (80%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/TestClient.java (88%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/TestHolder.java (95%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/{newzk => zookeeper/natived}/client/zookeeper/base/TestSupport.java (88%) rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/{ => curator}/CuratorZookeeperConfiguration.java (95%) create mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperExceptionHandler.java rename sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/{ZookeeperRegistryCenter.java => curator/CuratorZookeeperRegistryCenter.java} (92%) diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 30436094e8c65..e8eb606e5b943 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -10,9 +10,9 @@ "type": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", "name": "sharding.jdbc.config.orchestration.zookeeper", - "type": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration" + "type": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration" }, { "sourceType": "io.shardingsphere.core.yaml.sharding.YamlShardingStrategyConfiguration", @@ -111,46 +111,46 @@ "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", "name": "sharding.jdbc.config.orchestration.zookeeper.server-lists", "description": "Zookeeper server list.\n \n

Include ip address and port, multiple servers split by comma. Etc: {@code host1:2181,host2:2181}<\/p>.", "type": "java.lang.String" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", "name": "sharding.jdbc.config.orchestration.zookeeper.namespace", "description": "Namespace of registry center.", "type": "java.lang.String" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", "name": "sharding.jdbc.config.orchestration.zookeeper.digest", "description": "Digest for registry center.\n \n

Default is not need digest<\/p>.", "type": "java.lang.String" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", "defaultValue": 0, "name": "sharding.jdbc.config.orchestration.zookeeper.operation-timeout-milliseconds", "description": "Operation timeout time in milliseconds.", "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", "defaultValue": 3, "name": "sharding.jdbc.config.orchestration.zookeeper.max-retries", "description": "Max number of times to retry.", "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", "defaultValue": 1000, "name": "sharding.jdbc.config.orchestration.zookeeper.retry-interval-milliseconds", "description": "Time interval in milliseconds on each retry.", "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", "defaultValue": 0, "name": "sharding.jdbc.config.orchestration.zookeeper.time-to-live-seconds", "description": "Time to live in seconds of ephemeral keys.", diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/io/shardingsphere/shardingjdbc/spring/boot/util/EmbedTestingServer.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/io/shardingsphere/shardingjdbc/spring/boot/util/EmbedTestingServer.java index b002c11770ddf..547de3b97a45d 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/io/shardingsphere/shardingjdbc/spring/boot/util/EmbedTestingServer.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/io/shardingsphere/shardingjdbc/spring/boot/util/EmbedTestingServer.java @@ -17,7 +17,7 @@ package io.shardingsphere.shardingjdbc.spring.boot.util; -import io.shardingsphere.orchestration.reg.exception.RegExceptionHandler; +import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperExceptionHandler; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.curator.test.TestingServer; @@ -44,7 +44,7 @@ public static void start() { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } finally { Runtime.getRuntime().addShutdownHook(new Thread() { @@ -53,7 +53,7 @@ public void run() { try { testingServer.close(); } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } } }); diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java index 7c60d4429b983..ee16039d70ae9 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; -import io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration; +import io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration; import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.EtcdRegistryCenterBeanDefinitionParserTag; import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.ZookeeperRegistryCenterBeanDefinitionParserTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/io/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/io/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java index 72a9ecd9716e4..03e2a117b532f 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/io/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/io/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java @@ -17,7 +17,7 @@ package io.shardingsphere.shardingjdbc.orchestration.spring.util; -import io.shardingsphere.orchestration.reg.exception.RegExceptionHandler; +import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperExceptionHandler; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.curator.test.TestingServer; @@ -44,7 +44,7 @@ public static void start() { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } finally { Runtime.getRuntime().addShutdownHook(new Thread() { @@ -53,7 +53,7 @@ public void run() { try { testingServer.close(); } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } } }); diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/java/io/shardingsphere/shardingjdbc/orchestration/api/yaml/util/EmbedTestingServer.java b/sharding-jdbc/sharding-jdbc-orchestration/src/test/java/io/shardingsphere/shardingjdbc/orchestration/api/yaml/util/EmbedTestingServer.java index 112a56ea109e9..2efd88553c522 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/java/io/shardingsphere/shardingjdbc/orchestration/api/yaml/util/EmbedTestingServer.java +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/java/io/shardingsphere/shardingjdbc/orchestration/api/yaml/util/EmbedTestingServer.java @@ -17,7 +17,7 @@ package io.shardingsphere.shardingjdbc.orchestration.api.yaml.util; -import io.shardingsphere.orchestration.reg.exception.RegExceptionHandler; +import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperExceptionHandler; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.curator.test.TestingServer; @@ -44,7 +44,7 @@ public static void start() { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } finally { Runtime.getRuntime().addShutdownHook(new Thread() { @@ -53,7 +53,7 @@ public void run() { try { testingServer.close(); } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } } }); diff --git a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java index 6d9a30329140e..8a6965f0aadeb 100644 --- a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java +++ b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java @@ -32,10 +32,10 @@ import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; import io.shardingsphere.orchestration.reg.etcd.EtcdRegistryCenter; -import io.shardingsphere.orchestration.reg.newzk.NativeZookeeperConfiguration; -import io.shardingsphere.orchestration.reg.newzk.NewZookeeperRegistryCenter; -import io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration; -import io.shardingsphere.orchestration.reg.zookeeper.ZookeeperRegistryCenter; +import io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration; +import io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperRegistryCenter; +import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperConfiguration; +import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperRegistryCenter; import io.shardingsphere.shardingjdbc.jdbc.core.datasource.MasterSlaveDataSource; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -81,10 +81,10 @@ public OrchestrationFacade(final OrchestrationConfiguration orchestrationConfig) private RegistryCenter createRegistryCenter(final RegistryCenterConfiguration regCenterConfig) { Preconditions.checkNotNull(regCenterConfig, "Registry center configuration cannot be null."); if (regCenterConfig instanceof CuratorZookeeperConfiguration) { - return new ZookeeperRegistryCenter((CuratorZookeeperConfiguration) regCenterConfig); + return new CuratorZookeeperRegistryCenter((CuratorZookeeperConfiguration) regCenterConfig); } if (regCenterConfig instanceof NativeZookeeperConfiguration) { - return new NewZookeeperRegistryCenter((NativeZookeeperConfiguration) regCenterConfig); + return new NativeZookeeperRegistryCenter((NativeZookeeperConfiguration) regCenterConfig); } if (regCenterConfig instanceof EtcdConfiguration) { return new EtcdRegistryCenter((EtcdConfiguration) regCenterConfig); diff --git a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java index 053eb21fb8a99..fca5b9c1a818e 100644 --- a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java @@ -20,7 +20,7 @@ import com.google.common.base.Preconditions; import io.shardingsphere.orchestration.config.OrchestrationConfiguration; import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; -import io.shardingsphere.orchestration.reg.zookeeper.CuratorZookeeperConfiguration; +import io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration; import lombok.Getter; import lombok.Setter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegException.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegistryCenterException.java similarity index 80% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegException.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegistryCenterException.java index 9a4a5275a843f..77e0a3d3d4c39 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegException.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegistryCenterException.java @@ -22,15 +22,15 @@ * * @author zhangliang */ -public final class RegException extends RuntimeException { +public final class RegistryCenterException extends RuntimeException { private static final long serialVersionUID = -6417179023552012152L; - public RegException(final String errorMessage, final Object... args) { + public RegistryCenterException(final String errorMessage, final Object... args) { super(String.format(errorMessage, args)); } - public RegException(final Exception cause) { + public RegistryCenterException(final Exception cause) { super(cause); } } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java index 9bd9e60515500..73e76e6ef57d4 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java @@ -37,7 +37,7 @@ import io.shardingsphere.orchestration.reg.etcd.internal.keepalive.KeepAlive; import io.shardingsphere.orchestration.reg.etcd.internal.retry.EtcdRetryEngine; import io.shardingsphere.orchestration.reg.etcd.internal.watcher.EtcdWatchStreamObserver; -import io.shardingsphere.orchestration.reg.exception.RegException; +import io.shardingsphere.orchestration.reg.exception.RegistryCenterException; import io.shardingsphere.orchestration.reg.listener.EventListener; import mvccpb.Kv.KeyValue; @@ -144,7 +144,7 @@ public void update(final String key, final String value) { public void persistEphemeral(final String key, final String value) { final Optional leaseId = lease(); if (!leaseId.isPresent()) { - throw new RegException("Unable to set up heat beat for key %s", key); + throw new RegistryCenterException("Unable to set up heat beat for key %s", key); } final PutRequest request = PutRequest.newBuilder().setPrevKv(true).setLease(leaseId.get()).setKey(ByteString.copyFromUtf8(key)).setValue(ByteString.copyFromUtf8(value)).build(); etcdRetryEngine.execute(new Callable() { diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java index b96ba9c43055b..9827286711596 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java @@ -24,7 +24,7 @@ import com.github.rholder.retry.WaitStrategies; import com.google.common.base.Optional; import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; -import io.shardingsphere.orchestration.reg.exception.RegExceptionHandler; +import io.shardingsphere.orchestration.reg.exception.RegistryCenterException; import lombok.RequiredArgsConstructor; import java.util.concurrent.Callable; @@ -60,8 +60,7 @@ public Optional execute(final Callable callable) { try { return Optional.fromNullable(retryer.call(callable)); } catch (final ExecutionException | RetryException ex) { - RegExceptionHandler.handleException(ex); - return Optional.absent(); + throw new RegistryCenterException(ex); } } } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/watcher/EtcdWatchStreamObserver.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/watcher/EtcdWatchStreamObserver.java index 8364bfb3d7918..aec264632b767 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/watcher/EtcdWatchStreamObserver.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/watcher/EtcdWatchStreamObserver.java @@ -20,7 +20,7 @@ import etcdserverpb.Rpc; import etcdserverpb.Rpc.WatchResponse; import io.grpc.stub.StreamObserver; -import io.shardingsphere.orchestration.reg.exception.RegException; +import io.shardingsphere.orchestration.reg.exception.RegistryCenterException; import io.shardingsphere.orchestration.reg.listener.DataChangedEvent; import io.shardingsphere.orchestration.reg.listener.EventListener; import lombok.RequiredArgsConstructor; @@ -60,7 +60,7 @@ private DataChangedEvent.Type getEventType(final Event event) { @Override public void onError(final Throwable throwable) { // TODO retry watch later - throw new RegException(new Exception(throwable)); + throw new RegistryCenterException(new Exception(throwable)); } @Override diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NativeZookeeperConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperConfiguration.java similarity index 95% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NativeZookeeperConfiguration.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperConfiguration.java index 140d006b733fc..3715dab9ea217 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NativeZookeeperConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperConfiguration.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk; +package io.shardingsphere.orchestration.reg.zookeeper.natived; import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; import lombok.Getter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegExceptionHandler.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperExceptionHandler.java similarity index 84% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegExceptionHandler.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperExceptionHandler.java index 071b3b2f07a1e..5285bf94713d1 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/exception/RegExceptionHandler.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperExceptionHandler.java @@ -15,8 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.exception; +package io.shardingsphere.orchestration.reg.zookeeper.natived; +import io.shardingsphere.orchestration.reg.exception.RegistryCenterException; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -25,20 +26,20 @@ import org.apache.zookeeper.KeeperException.NodeExistsException; /** - * Registry center exception handler. + * Native zookeeper exception handler. * * @author zhangliang */ @Slf4j @NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class RegExceptionHandler { +public final class NativeZookeeperExceptionHandler { /** * Handle exception. * *

Ignore interrupt and connection invalid exception.

* - * @param cause to be handled exception. + * @param cause to be handled exception */ public static void handleException(final Exception cause) { if (null == cause) { @@ -49,7 +50,7 @@ public static void handleException(final Exception cause) { } else if (cause instanceof InterruptedException) { Thread.currentThread().interrupt(); } else { - throw new RegException(cause); + throw new RegistryCenterException(cause); } } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperRegistryCenter.java similarity index 79% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperRegistryCenter.java index 4c37d18e45183..4e92bb22581fe 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/NewZookeeperRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperRegistryCenter.java @@ -15,22 +15,21 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk; +package io.shardingsphere.orchestration.reg.zookeeper.natived; import com.google.common.base.Charsets; import com.google.common.base.Optional; import com.google.common.base.Strings; import io.shardingsphere.orchestration.reg.api.RegistryCenter; -import io.shardingsphere.orchestration.reg.exception.RegExceptionHandler; import io.shardingsphere.orchestration.reg.listener.DataChangedEvent; import io.shardingsphere.orchestration.reg.listener.EventListener; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.cache.PathTree; -import io.shardingsphere.orchestration.reg.newzk.client.retry.DelayRetryPolicy; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.ClientFactory; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.StrategyType; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache.PathTree; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.DelayRetryPolicy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.ClientFactory; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.StrategyType; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; @@ -50,23 +49,23 @@ * * @author lidongbo */ -public final class NewZookeeperRegistryCenter implements RegistryCenter { +public final class NativeZookeeperRegistryCenter implements RegistryCenter { private final IClient client; private final Map caches; - public NewZookeeperRegistryCenter(final NativeZookeeperConfiguration zkConfig) { + public NativeZookeeperRegistryCenter(final NativeZookeeperConfiguration zkConfig) { client = initClient(buildClientFactory(zkConfig), zkConfig); caches = new HashMap<>(); } - private ClientFactory buildClientFactory(final NativeZookeeperConfiguration zkConfig) { + private ClientFactory buildClientFactory(final NativeZookeeperConfiguration config) { ClientFactory result = new ClientFactory(); - result.setClientNamespace(zkConfig.getNamespace()).newClient(zkConfig.getServerLists(), zkConfig.getTimeToLiveSeconds() * 1000) - .setRetryPolicy(new DelayRetryPolicy(zkConfig.getRetryIntervalMilliseconds(), zkConfig.getMaxRetries(), zkConfig.getRetryIntervalMilliseconds())); - if (!Strings.isNullOrEmpty(zkConfig.getDigest())) { - result.authorization("digest", zkConfig.getDigest().getBytes(Charsets.UTF_8), ZooDefs.Ids.CREATOR_ALL_ACL); + result.setClientNamespace(config.getNamespace()).newClient(config.getServerLists(), config.getTimeToLiveSeconds() * 1000) + .setRetryPolicy(new DelayRetryPolicy(config.getRetryIntervalMilliseconds(), config.getMaxRetries(), config.getRetryIntervalMilliseconds())); + if (!Strings.isNullOrEmpty(config.getDigest())) { + result.authorization("digest", config.getDigest().getBytes(Charsets.UTF_8), ZooDefs.Ids.CREATOR_ALL_ACL); } return result; } @@ -83,7 +82,7 @@ private IClient initClient(final ClientFactory clientFactory, final NativeZookee } result.useExecStrategy(StrategyType.SYNC_RETRY); } catch (final KeeperException.OperationTimeoutException | IOException | InterruptedException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } return result; } @@ -115,7 +114,7 @@ public String getDirectly(final String key) { try { return new String(client.getData(key), Charsets.UTF_8); } catch (final KeeperException | InterruptedException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); return null; } } @@ -125,7 +124,7 @@ public boolean isExisted(final String key) { try { return client.checkExists(key); } catch (final KeeperException | InterruptedException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); return false; } } @@ -143,7 +142,7 @@ public int compare(final String o1, final String o2) { }); return result; } catch (final KeeperException | InterruptedException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); return Collections.emptyList(); } } @@ -157,7 +156,7 @@ public void persist(final String key, final String value) { update(key, value); } } catch (final KeeperException | InterruptedException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } } @@ -166,7 +165,7 @@ public void update(final String key, final String value) { try { client.transaction().check(key, ZookeeperConstants.VERSION).setData(key, value.getBytes(ZookeeperConstants.UTF_8), ZookeeperConstants.VERSION).commit(); } catch (final KeeperException | InterruptedException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } } @@ -178,7 +177,7 @@ public void persistEphemeral(final String key, final String value) { } client.createAllNeedPath(key, value, CreateMode.EPHEMERAL); } catch (final KeeperException | InterruptedException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } } @@ -219,7 +218,7 @@ private synchronized String getWithoutCache(final String key) { client.useExecStrategy(StrategyType.SYNC_RETRY); return null == data ? null : new String(data, Charsets.UTF_8); } catch (final KeeperException | InterruptedException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); return null; } } @@ -230,7 +229,7 @@ private void addCacheData(final String cachePath) { cache.load(); cache.watch(); } catch (final KeeperException | InterruptedException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } caches.put(cachePath + "/", cache); } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ContentionCallback.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/ContentionCallback.java similarity index 91% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ContentionCallback.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/ContentionCallback.java index 37c68212ec9eb..83c42baf9d1c5 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ContentionCallback.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/ContentionCallback.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.action; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.action; /** * Callback on contention has not reached. diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IAction.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IAction.java similarity index 98% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IAction.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IAction.java index 4604b1acfd92d..f0c119ab282e2 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IAction.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IAction.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.action; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.action; import org.apache.zookeeper.AsyncCallback; import org.apache.zookeeper.CreateMode; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IClient.java similarity index 86% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IClient.java index 42f705ca64b29..2be97e81032f7 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IClient.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IClient.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.action; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.action; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.StrategyType; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.BaseTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.StrategyType; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.BaseTransaction; import java.io.IOException; import java.util.concurrent.TimeUnit; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IExecStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IExecStrategy.java similarity index 84% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IExecStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IExecStrategy.java index dc4ba7a396c49..48337ffd384c3 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IExecStrategy.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IExecStrategy.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.action; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.action; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.BaseTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.BaseTransaction; /** * Client 's execution strategy. diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IGroupAction.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IGroupAction.java similarity index 96% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IGroupAction.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IGroupAction.java index 2957c9bbdcae1..c8acd37e759a0 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IGroupAction.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IGroupAction.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.action; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.action; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IProvider.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IProvider.java similarity index 94% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IProvider.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IProvider.java index aeaceeed26142..161f6d78cee9b 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/IProvider.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/IProvider.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.action; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.action; -import io.shardingsphere.orchestration.reg.newzk.client.election.LeaderElection; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.BaseTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.election.LeaderElection; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.BaseTransaction; import org.apache.zookeeper.AsyncCallback; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ITransactionProvider.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/ITransactionProvider.java similarity index 85% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ITransactionProvider.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/ITransactionProvider.java index 50e04dbad2325..11ad6590504b7 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/action/ITransactionProvider.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/action/ITransactionProvider.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.action; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.action; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.BaseTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.BaseTransaction; import org.apache.zookeeper.CreateMode; /** diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/CacheStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/CacheStrategy.java similarity index 90% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/CacheStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/CacheStrategy.java index 4aec445dca5c9..a725bf1a7f19e 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/CacheStrategy.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/CacheStrategy.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.cache; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache; /** * Cache strategy. diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathNode.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathNode.java similarity index 91% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathNode.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathNode.java index d1beee0daa78d..d587a7e667759 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathNode.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathNode.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.cache; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; import lombok.Getter; import lombok.Setter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolve.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathResolve.java similarity index 95% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolve.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathResolve.java index 556ebc2b001d7..0d4d1801143b1 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolve.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathResolve.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.cache; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathStatus.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathStatus.java similarity index 90% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathStatus.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathStatus.java index 3c57d9188f1e5..96332e691c4fb 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathStatus.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathStatus.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.cache; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache; /** * Path status. diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTree.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathTree.java similarity index 95% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTree.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathTree.java index 80a3f1a4ec9f3..12634e85fc3a3 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTree.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathTree.java @@ -15,15 +15,15 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.cache; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache; import com.google.common.base.Preconditions; import com.google.common.base.Strings; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/election/LeaderElection.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/election/LeaderElection.java similarity index 87% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/election/LeaderElection.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/election/LeaderElection.java index 2927b4eec11b5..4ee4bdea03707 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/election/LeaderElection.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/election/LeaderElection.java @@ -15,13 +15,13 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.election; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.election; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.WatcherCreator; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.WatcherCreator; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import lombok.extern.slf4j.Slf4j; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/AsyncRetryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/AsyncRetryCenter.java similarity index 91% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/AsyncRetryCenter.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/AsyncRetryCenter.java index 24ec2416b13c2..a2b21f2f70238 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/AsyncRetryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/AsyncRetryCenter.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.retry; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseOperation; import java.util.concurrent.DelayQueue; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayPolicyExecutor.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/DelayPolicyExecutor.java similarity index 95% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayPolicyExecutor.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/DelayPolicyExecutor.java index dc4fdc1d90d34..ade08f607f959 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayPolicyExecutor.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/DelayPolicyExecutor.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.retry; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry; import lombok.RequiredArgsConstructor; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayRetryPolicy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/DelayRetryPolicy.java similarity index 94% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayRetryPolicy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/DelayRetryPolicy.java index 8e13f1c62280c..0187fc21b0d8c 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/DelayRetryPolicy.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/DelayRetryPolicy.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.retry; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryCallable.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/RetryCallable.java similarity index 89% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryCallable.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/RetryCallable.java index a8dc4c01e8520..ded980ce40c8a 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryCallable.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/RetryCallable.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.retry; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.Connection; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.Connection; import lombok.AccessLevel; import lombok.Getter; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryResultCallable.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/RetryResultCallable.java similarity index 89% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryResultCallable.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/RetryResultCallable.java index 920ab382fb930..5f0570e86b28f 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryResultCallable.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/RetryResultCallable.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.retry; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; import lombok.Setter; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryThread.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/RetryThread.java similarity index 95% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryThread.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/RetryThread.java index ae8c741888a7a..3b1ffba5fa7d0 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/retry/RetryThread.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/RetryThread.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.retry; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseOperation; import lombok.extern.slf4j.Slf4j; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/PathUtil.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/utility/PathUtil.java similarity index 98% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/PathUtil.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/utility/PathUtil.java index f158ccbb1340f..8aa5baaa04bbe 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/PathUtil.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/utility/PathUtil.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.utility; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility; import com.google.common.base.Preconditions; import com.google.common.base.Strings; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/ZookeeperConstants.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/utility/ZookeeperConstants.java similarity index 95% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/ZookeeperConstants.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/utility/ZookeeperConstants.java index 8f86e3b766a0c..84de60548c1fb 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/utility/ZookeeperConstants.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/utility/ZookeeperConstants.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.utility; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/CacheClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/CacheClient.java similarity index 88% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/CacheClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/CacheClient.java index 8c9b1eb3e5402..37e2a9a7ced12 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/CacheClient.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/CacheClient.java @@ -15,13 +15,13 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper; -import io.shardingsphere.orchestration.reg.newzk.client.cache.CacheStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.cache.PathTree; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseContext; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache.CacheStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache.PathTree; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseContext; import org.apache.zookeeper.AsyncCallback; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/ClientFactory.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/ClientFactory.java similarity index 83% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/ClientFactory.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/ClientFactory.java index 38920c238cec0..b4e208e2346c2 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/ClientFactory.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/ClientFactory.java @@ -15,15 +15,15 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.retry.DelayRetryPolicy; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseClientFactory; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ClientContext; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.DelayRetryPolicy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseClientFactory; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ClientContext; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import org.apache.zookeeper.data.ACL; import java.io.IOException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/UsualClient.java similarity index 79% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/UsualClient.java index 6b0569a48e198..f6bd9593dbc7c 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClient.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/UsualClient.java @@ -15,22 +15,22 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper; -import io.shardingsphere.orchestration.reg.newzk.client.action.IExecStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.action.ITransactionProvider; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseClient; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseContext; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.provider.TransactionProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ClientContext; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.StrategyType; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.AsyncRetryStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.ContentionStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.SyncRetryStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.TransactionContendStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.UsualStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.BaseTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IExecStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.ITransactionProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseContext; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.provider.TransactionProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ClientContext; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.StrategyType; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.AsyncRetryStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.ContentionStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.SyncRetryStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.TransactionContendStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.UsualStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.BaseTransaction; import lombok.Getter; import org.apache.zookeeper.AsyncCallback; import org.apache.zookeeper.CreateMode; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseClient.java similarity index 89% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseClient.java index a97a0b5d67087..ad672a6b07b6e 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClient.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseClient.java @@ -15,15 +15,15 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; import com.google.common.base.Strings; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.StrategyType; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.WatcherCreator; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.StrategyType; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.WatcherCreator; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientFactory.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseClientFactory.java similarity index 90% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientFactory.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseClientFactory.java index 1ef4e3bd88b45..c828f56da3d70 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientFactory.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseClientFactory.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseContext.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseContext.java similarity index 86% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseContext.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseContext.java index a4e7a1006961f..33a428305e03b 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseContext.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseContext.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseOperation.java similarity index 86% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseOperation.java index 9a873258cd901..350eec4f91211 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseOperation.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseOperation.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.retry.DelayPolicyExecutor; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.Connection; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.DelayPolicyExecutor; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.Connection; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/Holder.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/Holder.java similarity index 96% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/Holder.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/Holder.java index 33229aec1b488..5ee67a3d16af2 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/Holder.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/Holder.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; import com.google.common.base.Strings; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateAllNeedOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/CreateAllNeedOperation.java similarity index 80% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateAllNeedOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/CreateAllNeedOperation.java index 3da53f3ccf417..862362b9686f5 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateAllNeedOperation.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/CreateAllNeedOperation.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseOperation; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.UsualStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.UsualStrategy; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateCurrentOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/CreateCurrentOperation.java similarity index 85% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateCurrentOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/CreateCurrentOperation.java index 5335aad5e9d34..a7932cf96be12 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/CreateCurrentOperation.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/CreateCurrentOperation.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseOperation; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteAllChildrenOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/DeleteAllChildrenOperation.java similarity index 77% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteAllChildrenOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/DeleteAllChildrenOperation.java index 189fa39280395..89cc17f964a19 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteAllChildrenOperation.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/DeleteAllChildrenOperation.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseOperation; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.UsualStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.UsualStrategy; import org.apache.zookeeper.KeeperException; /** diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentBranchOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/DeleteCurrentBranchOperation.java similarity index 77% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentBranchOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/DeleteCurrentBranchOperation.java index 324bcc43a63bb..7c2fc30fe223c 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentBranchOperation.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/DeleteCurrentBranchOperation.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseOperation; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.UsualStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.UsualStrategy; import org.apache.zookeeper.KeeperException; /** diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/DeleteCurrentOperation.java similarity index 82% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/DeleteCurrentOperation.java index 80de0d975a50a..d5eaf639ebf45 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/DeleteCurrentOperation.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/DeleteCurrentOperation.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseOperation; import org.apache.zookeeper.KeeperException; /** diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/UpdateOperation.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/UpdateOperation.java similarity index 83% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/UpdateOperation.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/UpdateOperation.java index 5160b9db112b6..c2d6aa9f357c2 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/operation/UpdateOperation.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/operation/UpdateOperation.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseOperation; import org.apache.zookeeper.KeeperException; /** diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/BaseProvider.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/provider/BaseProvider.java similarity index 88% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/BaseProvider.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/provider/BaseProvider.java index 9166cd708f7aa..529f93e613fc0 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/BaseProvider.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/provider/BaseProvider.java @@ -15,14 +15,14 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.provider; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.provider; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.election.LeaderElection; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.Holder; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.BaseTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.election.LeaderElection; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.Holder; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.BaseTransaction; import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/TransactionProvider.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/provider/TransactionProvider.java similarity index 71% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/TransactionProvider.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/provider/TransactionProvider.java index 32caba92a9a34..93f003f7fa966 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/provider/TransactionProvider.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/provider/TransactionProvider.java @@ -15,13 +15,13 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.provider; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.provider; -import io.shardingsphere.orchestration.reg.newzk.client.action.ITransactionProvider; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.Holder; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.BaseTransaction; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.ZooKeeperTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.ITransactionProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.Holder; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.BaseTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.ZooKeeperTransaction; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.data.ACL; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientContext.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/ClientContext.java similarity index 80% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientContext.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/ClientContext.java index 07bb8574c3050..dccc3093c4162 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientContext.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/ClientContext.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section; -import io.shardingsphere.orchestration.reg.newzk.client.retry.DelayRetryPolicy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseClientFactory; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseContext; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.DelayRetryPolicy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseClientFactory; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseContext; import lombok.Getter; import lombok.Setter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientTask.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/ClientTask.java similarity index 89% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientTask.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/ClientTask.java index a7949a3e01a2b..75415123dc229 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ClientTask.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/ClientTask.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/Connection.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/Connection.java similarity index 96% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/Connection.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/Connection.java index 81c639b9fc809..20cd367eea463 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/Connection.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/Connection.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/StrategyType.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/StrategyType.java similarity index 90% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/StrategyType.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/StrategyType.java index ad558000655f2..0195de83c68fd 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/StrategyType.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/StrategyType.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section; /** * Exec strategy type. diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/WatcherCreator.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/WatcherCreator.java similarity index 94% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/WatcherCreator.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/WatcherCreator.java index e93aa88f5bb88..2dcea7832ca55 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/WatcherCreator.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/WatcherCreator.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ZookeeperEventListener.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/ZookeeperEventListener.java similarity index 93% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ZookeeperEventListener.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/ZookeeperEventListener.java index fa56babef5425..f6b44f012add9 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/section/ZookeeperEventListener.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/section/ZookeeperEventListener.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section; import lombok.Getter; import lombok.Setter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/AsyncRetryStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/AsyncRetryStrategy.java similarity index 80% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/AsyncRetryStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/AsyncRetryStrategy.java index 6e68d2812c1a3..13b5e6fce9b42 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/AsyncRetryStrategy.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/AsyncRetryStrategy.java @@ -15,18 +15,18 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.retry.AsyncRetryCenter; -import io.shardingsphere.orchestration.reg.newzk.client.retry.DelayRetryPolicy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation.CreateAllNeedOperation; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation.CreateCurrentOperation; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation.DeleteAllChildrenOperation; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation.DeleteCurrentBranchOperation; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation.DeleteCurrentOperation; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.operation.UpdateOperation; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.Connection; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.AsyncRetryCenter; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.DelayRetryPolicy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation.CreateAllNeedOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation.CreateCurrentOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation.DeleteAllChildrenOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation.DeleteCurrentBranchOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation.DeleteCurrentOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.operation.UpdateOperation; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.Connection; import lombok.extern.slf4j.Slf4j; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/BaseStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/BaseStrategy.java similarity index 76% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/BaseStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/BaseStrategy.java index fb09491cae70d..527b68ed12216 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/BaseStrategy.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/BaseStrategy.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy; -import io.shardingsphere.orchestration.reg.newzk.client.action.IExecStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.BaseTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IExecStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.BaseTransaction; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/ContentionStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/ContentionStrategy.java similarity index 94% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/ContentionStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/ContentionStrategy.java index ba19753b9975c..8e26a1f736994 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/ContentionStrategy.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/ContentionStrategy.java @@ -15,13 +15,13 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy; -import io.shardingsphere.orchestration.reg.newzk.client.action.ContentionCallback; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.election.LeaderElection; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.ContentionCallback; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.election.LeaderElection; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; import lombok.extern.slf4j.Slf4j; import org.apache.zookeeper.AsyncCallback; import org.apache.zookeeper.CreateMode; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/SyncRetryStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/SyncRetryStrategy.java similarity index 93% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/SyncRetryStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/SyncRetryStrategy.java index ad6c4233aca4b..8f8f5f9ee6ab9 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/SyncRetryStrategy.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/SyncRetryStrategy.java @@ -15,12 +15,12 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.retry.DelayRetryPolicy; -import io.shardingsphere.orchestration.reg.newzk.client.retry.RetryCallable; -import io.shardingsphere.orchestration.reg.newzk.client.retry.RetryResultCallable; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.DelayRetryPolicy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.RetryCallable; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.RetryResultCallable; import lombok.AccessLevel; import lombok.Getter; import org.apache.zookeeper.CreateMode; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/TransactionContendStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/TransactionContendStrategy.java similarity index 88% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/TransactionContendStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/TransactionContendStrategy.java index 4babc3c4d78b3..edc64ac92196b 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/TransactionContendStrategy.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/TransactionContendStrategy.java @@ -15,15 +15,15 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy; -import io.shardingsphere.orchestration.reg.newzk.client.action.ContentionCallback; -import io.shardingsphere.orchestration.reg.newzk.client.action.ITransactionProvider; -import io.shardingsphere.orchestration.reg.newzk.client.election.LeaderElection; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.provider.BaseProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.ZooKeeperTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.ContentionCallback; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.ITransactionProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.election.LeaderElection; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.provider.BaseProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.ZooKeeperTransaction; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/UsualStrategy.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/UsualStrategy.java similarity index 94% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/UsualStrategy.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/UsualStrategy.java index 8d01d71edee12..697842cedbf10 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/strategy/UsualStrategy.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/strategy/UsualStrategy.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; import lombok.extern.slf4j.Slf4j; import org.apache.zookeeper.AsyncCallback; import org.apache.zookeeper.CreateMode; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/BaseTransaction.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/transaction/BaseTransaction.java similarity index 97% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/BaseTransaction.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/transaction/BaseTransaction.java index bcb7b8ab24c7e..390cc30819c6a 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/BaseTransaction.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/transaction/BaseTransaction.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/ZooKeeperTransaction.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/transaction/ZooKeeperTransaction.java similarity index 88% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/ZooKeeperTransaction.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/transaction/ZooKeeperTransaction.java index 9c173a7013b59..2d99e7b2c512d 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/transaction/ZooKeeperTransaction.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/transaction/ZooKeeperTransaction.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.Holder; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.Holder; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.OpResult; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/AllNewzkTests.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/AllNativeZookeeperTests.java similarity index 61% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/AllNewzkTests.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/AllNativeZookeeperTests.java index 3fb169306c5ae..d2c9866739e60 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/AllNewzkTests.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/AllNativeZookeeperTests.java @@ -15,13 +15,13 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk; +package io.shardingsphere.orchestration.reg.zookeeper.natived; -import io.shardingsphere.orchestration.reg.newzk.client.cache.PathResolveTest; -import io.shardingsphere.orchestration.reg.newzk.client.cache.PathTreeTest; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.AllBaseTests; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.SyncRetryStrategyTest; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.UsualClientTest; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache.PathResolveTest; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache.PathTreeTest; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.AllBaseTests; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.SyncRetryStrategyTest; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.UsualClientTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @@ -34,5 +34,5 @@ AllBaseTests.class, UsualClientTest.class }) -public final class AllNewzkTests { +public final class AllNativeZookeeperTests { } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolveTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathResolveTest.java similarity index 96% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolveTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathResolveTest.java index e3db3364b4295..8cba2e815f46c 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathResolveTest.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathResolveTest.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.cache; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache; import org.junit.Test; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTreeTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathTreeTest.java similarity index 89% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTreeTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathTreeTest.java index c5124baa5534e..1813d1e40e9ab 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/cache/PathTreeTest.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/cache/PathTreeTest.java @@ -15,17 +15,18 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.cache; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.cache; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.util.EmbedTestingServer; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.ClientFactory; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseTest; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.TestSupport; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.util.EmbedTestingServer; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.ClientFactory; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseTest; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.TestSupport; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.ZooDefs; +import org.hamcrest.CoreMatchers; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -109,7 +110,7 @@ public void assertPut() { final String key = "a/b/bb"; final String value = "bbb11"; pathTree.put(key, value); - assertThat(pathTree.getValue("a"), is(ZookeeperConstants.NOTHING_DATA)); + assertThat(pathTree.getValue("a"), CoreMatchers.is(ZookeeperConstants.NOTHING_DATA)); assertThat(pathTree.getValue("a/b"), is(ZookeeperConstants.NOTHING_DATA)); assertThat(pathTree.getValue(key), is(value.getBytes(ZookeeperConstants.UTF_8))); } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestCallable.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/TestCallable.java similarity index 85% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestCallable.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/TestCallable.java index 4a38639b507c3..d58431b2c7612 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestCallable.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/TestCallable.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.retry; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.provider.BaseProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.provider.BaseProvider; import org.apache.zookeeper.KeeperException; public abstract class TestCallable extends RetryCallable { diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestResultCallable.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/TestResultCallable.java similarity index 85% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestResultCallable.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/TestResultCallable.java index 82527e2162782..15bf4af5f832e 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/retry/TestResultCallable.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/retry/TestResultCallable.java @@ -15,10 +15,10 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.retry; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.provider.BaseProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.provider.BaseProvider; import org.apache.zookeeper.KeeperException; public abstract class TestResultCallable extends RetryResultCallable { diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/util/EmbedTestingServer.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/util/EmbedTestingServer.java similarity index 84% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/util/EmbedTestingServer.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/util/EmbedTestingServer.java index b75cdc067d34c..f3713472fdf67 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/util/EmbedTestingServer.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/util/EmbedTestingServer.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.util; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.util; -import io.shardingsphere.orchestration.reg.exception.RegExceptionHandler; +import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperExceptionHandler; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.curator.test.TestingServer; @@ -44,7 +44,7 @@ public static void start() { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } finally { Runtime.getRuntime().addShutdownHook(new Thread() { @@ -53,7 +53,7 @@ public void run() { try { testingServer.close(); } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + NativeZookeeperExceptionHandler.handleException(ex); } } }); diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/AllBaseTests.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/AllBaseTests.java similarity index 82% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/AllBaseTests.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/AllBaseTests.java index b9d3849538e07..f7a6a1c50c16f 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/AllBaseTests.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/AllBaseTests.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.StartWaitTest; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.StartWaitTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/SyncRetryStrategyTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/SyncRetryStrategyTest.java similarity index 91% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/SyncRetryStrategyTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/SyncRetryStrategyTest.java index 1e4a943e8b6e4..c68e6a78edb91 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/SyncRetryStrategyTest.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/SyncRetryStrategyTest.java @@ -15,17 +15,17 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.action.IProvider; -import io.shardingsphere.orchestration.reg.newzk.client.retry.DelayRetryPolicy; -import io.shardingsphere.orchestration.reg.newzk.client.retry.TestCallable; -import io.shardingsphere.orchestration.reg.newzk.client.retry.TestResultCallable; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.TestSupport; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.StrategyType; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.UsualStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IProvider; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.DelayRetryPolicy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.TestCallable; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.retry.TestResultCallable; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.TestSupport; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.StrategyType; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.UsualStrategy; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.ZooDefs; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClientTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/UsualClientTest.java similarity index 82% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClientTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/UsualClientTest.java index cffc72654e5d4..d1a30154c65eb 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/UsualClientTest.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/UsualClientTest.java @@ -15,19 +15,19 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.BaseClientTest; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base.TestSupport; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.StrategyType; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.AsyncRetryStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.ContentionStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.SyncRetryStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.TransactionContendStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.strategy.UsualStrategy; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.transaction.BaseTransaction; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.BaseClientTest; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base.TestSupport; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.StrategyType; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.AsyncRetryStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.ContentionStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.SyncRetryStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.TransactionContendStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.strategy.UsualStrategy; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.transaction.BaseTransaction; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.ZooDefs; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseClientTest.java similarity index 95% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseClientTest.java index d1dc300669161..18f725adf0766 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseClientTest.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseClientTest.java @@ -15,14 +15,14 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.util.EmbedTestingServer; -import io.shardingsphere.orchestration.reg.newzk.client.utility.PathUtil; -import io.shardingsphere.orchestration.reg.newzk.client.utility.ZookeeperConstants; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.ClientFactory; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.util.EmbedTestingServer; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.PathUtil; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.utility.ZookeeperConstants; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.ClientFactory; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import lombok.Getter; import org.apache.zookeeper.AsyncCallback; import org.apache.zookeeper.CreateMode; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseTest.java similarity index 87% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseTest.java index 480285a159352..4ef59decefb1a 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/BaseTest.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/BaseTest.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; import org.apache.zookeeper.KeeperException; public class BaseTest { diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/StartWaitTest.java similarity index 80% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/StartWaitTest.java index 3593ad1af6f43..5f213fba77cbd 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/StartWaitTest.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/StartWaitTest.java @@ -15,11 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; -import io.shardingsphere.orchestration.reg.newzk.client.action.IClient; -import io.shardingsphere.orchestration.reg.newzk.client.util.EmbedTestingServer; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ClientContext; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.util.EmbedTestingServer; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ClientContext; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestClient.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/TestClient.java similarity index 88% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestClient.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/TestClient.java index 574d3d702a4d8..04b44851895db 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestClient.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/TestClient.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.UsualClient; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.UsualClient; import org.apache.zookeeper.ZooKeeper; import java.io.IOException; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestHolder.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/TestHolder.java similarity index 95% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestHolder.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/TestHolder.java index 86b3fd6e9ccf2..1c5c760457f09 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestHolder.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/TestHolder.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; import org.apache.zookeeper.WatchedEvent; import org.apache.zookeeper.Watcher; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestSupport.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/TestSupport.java similarity index 88% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestSupport.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/TestSupport.java index fe8dd857a2158..e75fdc9ac38d4 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/newzk/client/zookeeper/base/TestSupport.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/java/io/shardingsphere/orchestration/reg/zookeeper/natived/client/zookeeper/base/TestSupport.java @@ -15,9 +15,9 @@ *

*/ -package io.shardingsphere.orchestration.reg.newzk.client.zookeeper.base; +package io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.base; -import io.shardingsphere.orchestration.reg.newzk.client.zookeeper.section.ZookeeperEventListener; +import io.shardingsphere.orchestration.reg.zookeeper.natived.client.zookeeper.section.ZookeeperEventListener; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/resources/logback-test.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/resources/logback-test.xml index 1cb0de791ca6c..0ac5601568948 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/resources/logback-test.xml +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/test/resources/logback-test.xml @@ -8,7 +8,7 @@ - + diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/CuratorZookeeperConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperConfiguration.java similarity index 95% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/CuratorZookeeperConfiguration.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperConfiguration.java index d1cd3bc2b0495..21bb36580e5e4 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/CuratorZookeeperConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperConfiguration.java @@ -15,7 +15,7 @@ *

*/ -package io.shardingsphere.orchestration.reg.zookeeper; +package io.shardingsphere.orchestration.reg.zookeeper.curator; import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; import lombok.Getter; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperExceptionHandler.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperExceptionHandler.java new file mode 100644 index 0000000000000..2cb0dc4752dcb --- /dev/null +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperExceptionHandler.java @@ -0,0 +1,60 @@ +/* + * Copyright 2016-2018 shardingsphere.io. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *

+ */ + +package io.shardingsphere.orchestration.reg.zookeeper.curator; + +import io.shardingsphere.orchestration.reg.exception.RegistryCenterException; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.zookeeper.KeeperException.ConnectionLossException; +import org.apache.zookeeper.KeeperException.NoNodeException; +import org.apache.zookeeper.KeeperException.NodeExistsException; + +/** + * Curator zookeeper exception handler. + * + * @author zhangliang + */ +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public final class CuratorZookeeperExceptionHandler { + + /** + * Handle exception. + * + *

Ignore interrupt and connection invalid exception.

+ * + * @param cause to be handled exception + */ + public static void handleException(final Exception cause) { + if (null == cause) { + return; + } + if (isIgnoredException(cause) || null != cause.getCause() && isIgnoredException(cause.getCause())) { + log.debug("Ignored exception for: {}", cause.getMessage()); + } else if (cause instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } else { + throw new RegistryCenterException(cause); + } + } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof ConnectionLossException || cause instanceof NoNodeException || cause instanceof NodeExistsException; + } +} diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperRegistryCenter.java similarity index 92% rename from sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java rename to sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperRegistryCenter.java index d2c83f0b52d05..d6f11489884eb 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/ZookeeperRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperRegistryCenter.java @@ -15,12 +15,11 @@ *

*/ -package io.shardingsphere.orchestration.reg.zookeeper; +package io.shardingsphere.orchestration.reg.zookeeper.curator; import com.google.common.base.Charsets; import com.google.common.base.Strings; import io.shardingsphere.orchestration.reg.api.RegistryCenter; -import io.shardingsphere.orchestration.reg.exception.RegExceptionHandler; import io.shardingsphere.orchestration.reg.listener.DataChangedEvent; import io.shardingsphere.orchestration.reg.listener.EventListener; import org.apache.curator.framework.CuratorFramework; @@ -51,13 +50,13 @@ * * @author zhangliang */ -public final class ZookeeperRegistryCenter implements RegistryCenter { +public final class CuratorZookeeperRegistryCenter implements RegistryCenter { private final CuratorFramework client; private final Map caches = new HashMap<>(); - public ZookeeperRegistryCenter(final CuratorZookeeperConfiguration zkConfig) { + public CuratorZookeeperRegistryCenter(final CuratorZookeeperConfiguration zkConfig) { client = buildCuratorClient(zkConfig); initCuratorClient(zkConfig); } @@ -99,7 +98,7 @@ private void initCuratorClient(final CuratorZookeeperConfiguration zkConfig) { throw new OperationTimeoutException(); } } catch (final InterruptedException | OperationTimeoutException ex) { - RegExceptionHandler.handleException(ex); + CuratorZookeeperExceptionHandler.handleException(ex); } } @@ -132,7 +131,7 @@ public String getDirectly(final String key) { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + CuratorZookeeperExceptionHandler.handleException(ex); return null; } } @@ -144,7 +143,7 @@ public boolean isExisted(final String key) { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + CuratorZookeeperExceptionHandler.handleException(ex); return false; } } @@ -164,7 +163,7 @@ public int compare(final String o1, final String o2) { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + CuratorZookeeperExceptionHandler.handleException(ex); return Collections.emptyList(); } } @@ -180,7 +179,7 @@ public void persist(final String key, final String value) { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + CuratorZookeeperExceptionHandler.handleException(ex); } } @@ -191,7 +190,7 @@ public void update(final String key, final String value) { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + CuratorZookeeperExceptionHandler.handleException(ex); } } @@ -205,7 +204,7 @@ public void persistEphemeral(final String key, final String value) { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + CuratorZookeeperExceptionHandler.handleException(ex); } } @@ -247,7 +246,7 @@ private void addCacheData(final String cachePath) { // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + CuratorZookeeperExceptionHandler.handleException(ex); } caches.put(cachePath + "/", cache); } From 2dd0d562501bceb11c6df399aad58e63d7372a1e Mon Sep 17 00:00:00 2001 From: cherrylzhao Date: Wed, 17 Oct 2018 16:15:58 +0800 Subject: [PATCH 25/30] resolve parameters of proxy prepare statement can't set correctly. --- .../backend/jdbc/execute/JDBCExecuteEngine.java | 2 +- .../backend/jdbc/wrapper/JDBCExecutorWrapper.java | 5 +++-- .../wrapper/PreparedStatementExecutorWrapper.java | 14 ++++++++++++-- .../jdbc/wrapper/StatementExecutorWrapper.java | 2 +- .../src/main/resources/conf/config-sharding.yaml | 1 + 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/execute/JDBCExecuteEngine.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/execute/JDBCExecuteEngine.java index d3708fc714999..66a1f6fdea2d6 100644 --- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/execute/JDBCExecuteEngine.java +++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/execute/JDBCExecuteEngine.java @@ -183,7 +183,7 @@ public List getConnections(final ConnectionMode connectionMode, fina @Override public StatementExecuteUnit createStatementExecuteUnit(final Connection connection, final RouteUnit routeUnit, final ConnectionMode connectionMode) throws SQLException { - Statement statement = getJdbcExecutorWrapper().createStatement(connection, routeUnit.getSqlUnit().getSql(), isReturnGeneratedKeys); + Statement statement = getJdbcExecutorWrapper().createStatement(connection, routeUnit.getSqlUnit(), isReturnGeneratedKeys); if (connectionMode.equals(ConnectionMode.MEMORY_STRICTLY)) { statement.setFetchSize(MEMORY_FETCH_ONE_ROW_A_TIME); } diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/JDBCExecutorWrapper.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/JDBCExecutorWrapper.java index e3e38547a8d78..163730cf9b4a5 100644 --- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/JDBCExecutorWrapper.java +++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/JDBCExecutorWrapper.java @@ -19,6 +19,7 @@ import io.shardingsphere.core.constant.DatabaseType; import io.shardingsphere.core.routing.SQLRouteResult; +import io.shardingsphere.core.routing.SQLUnit; import java.sql.Connection; import java.sql.SQLException; @@ -44,12 +45,12 @@ public interface JDBCExecutorWrapper { * Create statement. * * @param connection connection - * @param sql SQL + * @param sqlUnit sql unit * @param isReturnGeneratedKeys is return generated keys * @return statement * @throws SQLException SQL exception */ - Statement createStatement(Connection connection, String sql, boolean isReturnGeneratedKeys) throws SQLException; + Statement createStatement(Connection connection, SQLUnit sqlUnit, boolean isReturnGeneratedKeys) throws SQLException; /** * Execute SQL. diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/PreparedStatementExecutorWrapper.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/PreparedStatementExecutorWrapper.java index bbbd634b5fc40..3f093956eb6ee 100644 --- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/PreparedStatementExecutorWrapper.java +++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/PreparedStatementExecutorWrapper.java @@ -35,6 +35,7 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.Collections; +import java.util.LinkedList; import java.util.List; /** @@ -72,8 +73,9 @@ private SQLRouteResult doShardingRoute(final String sql, final DatabaseType data } @Override - public Statement createStatement(final Connection connection, final String sql, final boolean isReturnGeneratedKeys) throws SQLException { - PreparedStatement result = isReturnGeneratedKeys ? connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS) : connection.prepareStatement(sql); + public Statement createStatement(final Connection connection, final SQLUnit sqlUnit, final boolean isReturnGeneratedKeys) throws SQLException { + PreparedStatement result = isReturnGeneratedKeys ? connection.prepareStatement(sqlUnit.getSql(), Statement.RETURN_GENERATED_KEYS) : connection.prepareStatement(sqlUnit.getSql()); + List parameters = getRoutedParameters(sqlUnit); for (int i = 0; i < parameters.size(); i++) { result.setObject(i + 1, parameters.get(i)); } @@ -84,4 +86,12 @@ public Statement createStatement(final Connection connection, final String sql, public boolean executeSQL(final Statement statement, final String sql, final boolean isReturnGeneratedKeys) throws SQLException { return ((PreparedStatement) statement).execute(); } + + private List getRoutedParameters(final SQLUnit sqlUnit) { + List result = new LinkedList<>(); + for (List each : sqlUnit.getParameterSets()) { + result.addAll(each); + } + return result; + } } diff --git a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/StatementExecutorWrapper.java b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/StatementExecutorWrapper.java index 1716417c0c53d..bedec3c89f85b 100644 --- a/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/StatementExecutorWrapper.java +++ b/sharding-proxy/src/main/java/io/shardingsphere/shardingproxy/backend/jdbc/wrapper/StatementExecutorWrapper.java @@ -70,7 +70,7 @@ private SQLRouteResult doShardingRoute(final String sql, final DatabaseType data } @Override - public Statement createStatement(final Connection connection, final String sql, final boolean isReturnGeneratedKeys) throws SQLException { + public Statement createStatement(final Connection connection, final SQLUnit sqlUnit, final boolean isReturnGeneratedKeys) throws SQLException { return connection.createStatement(); } diff --git a/sharding-proxy/src/main/resources/conf/config-sharding.yaml b/sharding-proxy/src/main/resources/conf/config-sharding.yaml index 623f24a53d293..09cf66f7455df 100644 --- a/sharding-proxy/src/main/resources/conf/config-sharding.yaml +++ b/sharding-proxy/src/main/resources/conf/config-sharding.yaml @@ -45,6 +45,7 @@ # inline: # shardingColumn: order_id # algorithmExpression: t_order_item_${order_id % 2} +# keyGeneratorColumnName: order_item_id # bindingTables: # - t_order,t_order_item # defaultDatabaseStrategy: From b99a67768fa6f30eb2c329f61f92ac2fe9e17d7e Mon Sep 17 00:00:00 2001 From: terrymanu Date: Wed, 17 Oct 2018 17:56:25 +0800 Subject: [PATCH 26/30] for #1215, use SPI to handle registry center --- .../pom.xml | 7 ++ ...itional-spring-configuration-metadata.json | 81 +++++-------------- .../spring/boot/util/EmbedTestingServer.java | 19 +++-- .../application-masterslave.properties | 4 +- .../resources/application-sharding.properties | 4 +- .../pom.xml | 6 ++ ...RegistryCenterBeanDefinitionParserTag.java | 42 ---------- ...egistryCenterBeanDefinitionParserTag.java} | 6 +- .../OrchestrationNamespaceHandler.java | 6 +- .../parser/RegBeanDefinitionParser.java | 36 +++------ .../META-INF/namespace/orchestration.xsd | 15 +--- .../spring/util/EmbedTestingServer.java | 19 +++-- .../META-INF/rdb/masterSlaveOrchestration.xml | 2 +- .../rdb/shardingMasterSlaveOrchestration.xml | 2 +- .../META-INF/rdb/shardingOrchestration.xml | 2 +- .../sharding-jdbc-orchestration/pom.xml | 15 +--- .../api/yaml/util/EmbedTestingServer.java | 19 +++-- ...figWithMasterSlaveDataSourceWithProps.yaml | 4 +- ...WithMasterSlaveDataSourceWithoutProps.yaml | 4 +- .../configWithDataSourceWithProps.yaml | 4 +- .../configWithDataSourceWithoutProps.yaml | 4 +- .../configWithoutDataSourceWithProps.yaml | 4 +- .../configWithoutDataSourceWithoutProps.yaml | 4 +- .../configWithDataSourceWithProps.yaml | 4 +- .../configWithDataSourceWithoutProps.yaml | 4 +- .../configWithoutDataSourceWithProps.yaml | 4 +- .../configWithoutDataSourceWithoutProps.yaml | 4 +- .../sharding-orchestration-core/pom.xml | 18 ++--- .../internal/OrchestrationFacade.java | 29 +++---- .../yaml/YamlOrchestrationConfiguration.java | 11 +-- .../orchestration/reg/api/RegistryCenter.java | 7 ++ .../reg/api/RegistryCenterConfiguration.java | 49 +++++------ .../reg/listener/DataChangedEvent.java | 2 +- .../reg/etcd/EtcdConfiguration.java | 57 ------------- .../reg/etcd/EtcdRegistryCenter.java | 37 +++++---- .../etcd/internal/retry/EtcdRetryEngine.java | 8 +- ...phere.orchestration.reg.api.RegistryCenter | 1 + .../natived/NativeZookeeperConfiguration.java | 54 ------------- .../NativeZookeeperRegistryCenter.java | 19 ++--- ...phere.orchestration.reg.api.RegistryCenter | 1 + .../CuratorZookeeperConfiguration.java | 54 ------------- .../CuratorZookeeperRegistryCenter.java | 36 +++++---- ...phere.orchestration.reg.api.RegistryCenter | 1 + .../src/main/resources/conf/server.yaml | 4 +- .../ShardingConfigurationLoaderTest.java | 5 +- .../src/test/resources/conf/server.yaml | 4 +- 46 files changed, 228 insertions(+), 494 deletions(-) delete mode 100644 sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/EtcdRegistryCenterBeanDefinitionParserTag.java rename sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/{ZookeeperRegistryCenterBeanDefinitionParserTag.java => RegistryCenterBeanDefinitionParserTag.java} (88%) delete mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java create mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter delete mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperConfiguration.java create mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter delete mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperConfiguration.java create mode 100644 sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/pom.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/pom.xml index eef098b14c9e7..2c7ff22538c22 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/pom.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/pom.xml @@ -8,6 +8,13 @@ sharding-jdbc-orchestration-spring-boot-starter + + io.shardingsphere + sharding-orchestration-reg-zookeeper-curator + ${project.version} + test + + org.springframework.boot spring-boot-starter diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index e8eb606e5b943..b245571c57480 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -5,14 +5,9 @@ "type": "io.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration" }, { - "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "name": "sharding.jdbc.config.orchestration.etcd", - "type": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration" - }, - { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", - "name": "sharding.jdbc.config.orchestration.zookeeper", - "type": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration" + "sourceType": "io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration", + "name": "sharding.jdbc.config.orchestration.registry", + "type": "io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration" }, { "sourceType": "io.shardingsphere.core.yaml.sharding.YamlShardingStrategyConfiguration", @@ -77,82 +72,48 @@ "sourceType": "io.shardingsphere.shardingjdbc.util.DataSourceUtil" }, { - "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "name": "sharding.jdbc.config.orchestration.etcd.server-lists", - "description": "Etcd server list.\n \n

Include ip address and port, multiple servers split by comma. Etc: {@code http:\/\/host1:2379,http:\/\/host2:2379}<\/p>.", - "type": "java.lang.String" - }, - { - "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "defaultValue": 500, - "name": "sharding.jdbc.config.orchestration.etcd.operation-timeout-milliseconds", - "description": "Operation timeout time in milliseconds.", - "type": "java.lang.Integer" - }, - { - "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "defaultValue": 3, - "name": "sharding.jdbc.config.orchestration.etcd.max-retries", - "description": "Max number of times to retry.", - "type": "java.lang.Integer" - }, - { - "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "defaultValue": 200, - "name": "sharding.jdbc.config.orchestration.etcd.retry-interval-milliseconds", - "description": "Time interval in milliseconds on each retry.", - "type": "java.lang.Integer" - }, - { - "sourceType": "io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration", - "defaultValue": 60, - "name": "sharding.jdbc.config.orchestration.etcd.time-to-live-seconds", - "description": "Time to live in seconds of ephemeral keys.", - "type": "java.lang.Integer" - }, - { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", - "name": "sharding.jdbc.config.orchestration.zookeeper.server-lists", - "description": "Zookeeper server list.\n \n

Include ip address and port, multiple servers split by comma. Etc: {@code host1:2181,host2:2181}<\/p>.", + "sourceType": "io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration", + "name": "sharding.jdbc.config.orchestration.registry.server-lists", + "description": "Registry center server list.", "type": "java.lang.String" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", - "name": "sharding.jdbc.config.orchestration.zookeeper.namespace", + "sourceType": "io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration", + "name": "sharding.jdbc.config.orchestration.registry.namespace", "description": "Namespace of registry center.", "type": "java.lang.String" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", - "name": "sharding.jdbc.config.orchestration.zookeeper.digest", + "sourceType": "io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration", + "name": "sharding.jdbc.config.orchestration.registry.digest", "description": "Digest for registry center.\n \n

Default is not need digest<\/p>.", "type": "java.lang.String" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", - "defaultValue": 0, - "name": "sharding.jdbc.config.orchestration.zookeeper.operation-timeout-milliseconds", + "sourceType": "io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration", + "defaultValue": 500, + "name": "sharding.jdbc.config.orchestration.registry.operation-timeout-milliseconds", "description": "Operation timeout time in milliseconds.", "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", + "sourceType": "io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration", "defaultValue": 3, - "name": "sharding.jdbc.config.orchestration.zookeeper.max-retries", + "name": "sharding.jdbc.config.orchestration.registry.max-retries", "description": "Max number of times to retry.", "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", - "defaultValue": 1000, - "name": "sharding.jdbc.config.orchestration.zookeeper.retry-interval-milliseconds", + "sourceType": "io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration", + "defaultValue": 500, + "name": "sharding.jdbc.config.orchestration.registry.retry-interval-milliseconds", "description": "Time interval in milliseconds on each retry.", "type": "java.lang.Integer" }, { - "sourceType": "io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration", - "defaultValue": 0, - "name": "sharding.jdbc.config.orchestration.zookeeper.time-to-live-seconds", + "sourceType": "io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration", + "defaultValue": 500, + "name": "sharding.jdbc.config.orchestration.registry.time-to-live-seconds", "description": "Time to live in seconds of ephemeral keys.", "type": "java.lang.Integer" }, diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/io/shardingsphere/shardingjdbc/spring/boot/util/EmbedTestingServer.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/io/shardingsphere/shardingjdbc/spring/boot/util/EmbedTestingServer.java index 547de3b97a45d..83aadc3fde602 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/io/shardingsphere/shardingjdbc/spring/boot/util/EmbedTestingServer.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/java/io/shardingsphere/shardingjdbc/spring/boot/util/EmbedTestingServer.java @@ -17,10 +17,12 @@ package io.shardingsphere.shardingjdbc.spring.boot.util; -import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperExceptionHandler; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.curator.test.TestingServer; +import org.apache.zookeeper.KeeperException.ConnectionLossException; +import org.apache.zookeeper.KeeperException.NoNodeException; +import org.apache.zookeeper.KeeperException.NodeExistsException; import java.io.File; import java.io.IOException; @@ -41,22 +43,25 @@ public static void start() { } try { testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); - // CHECKSTYLE:OFF } catch (final Exception ex) { - // CHECKSTYLE:ON - NativeZookeeperExceptionHandler.handleException(ex); + if (!isIgnoredException(ex)) { + throw new RuntimeException(ex); + } } finally { Runtime.getRuntime().addShutdownHook(new Thread() { - + @Override public void run() { try { testingServer.close(); - } catch (final IOException ex) { - NativeZookeeperExceptionHandler.handleException(ex); + } catch (final IOException ignore) { } } }); } } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof ConnectionLossException || cause instanceof NoNodeException || cause instanceof NodeExistsException; + } } diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/resources/application-masterslave.properties b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/resources/application-masterslave.properties index d9f23e066841a..f551a5d14fa48 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/resources/application-masterslave.properties +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/resources/application-masterslave.properties @@ -27,8 +27,8 @@ sharding.jdbc.config.masterslave.slave-data-source-names=ds_slave_0,ds_slave_1 sharding.jdbc.config.orchestration.name=demo_spring_boot_ds_ms sharding.jdbc.config.orchestration.overwrite=true -sharding.jdbc.config.orchestration.zookeeper.namespace=orchestration-spring-boot-master-slave-test -sharding.jdbc.config.orchestration.zookeeper.server-lists=localhost:3181 +sharding.jdbc.config.orchestration.registry.namespace=orchestration-spring-boot-master-slave-test +sharding.jdbc.config.orchestration.registry.server-lists=localhost:3181 sharding.jdbc.config.masterslave.config-map.key1=value1 sharding.jdbc.config.masterslave.config-map.key2=${sharding.jdbc.config.masterslave.config-map.key1} diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/resources/application-sharding.properties b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/resources/application-sharding.properties index 47d59d33c4b05..0f61eb2b5b513 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/resources/application-sharding.properties +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/src/test/resources/application-sharding.properties @@ -37,7 +37,7 @@ sharding.jdbc.config.sharding.props.executor.size=100 sharding.jdbc.config.orchestration.name=demo_spring_boot_ds_sharding sharding.jdbc.config.orchestration.overwrite=true -sharding.jdbc.config.orchestration.zookeeper.namespace=orchestration-spring-boot-sharding-test -sharding.jdbc.config.orchestration.zookeeper.server-lists=localhost:3181 +sharding.jdbc.config.orchestration.registry.namespace=orchestration-spring-boot-sharding-test +sharding.jdbc.config.orchestration.registry.server-lists=localhost:3181 sharding.jdbc.config.sharding.config-map.key1=value1 \ No newline at end of file diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/pom.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/pom.xml index d9f4d7954e447..2c9a346cd48c8 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/pom.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/pom.xml @@ -14,6 +14,12 @@ ${project.version} test + + io.shardingsphere + sharding-orchestration-reg-zookeeper-curator + ${project.version} + test + org.springframework diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/EtcdRegistryCenterBeanDefinitionParserTag.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/EtcdRegistryCenterBeanDefinitionParserTag.java deleted file mode 100644 index 21f42c4f97470..0000000000000 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/EtcdRegistryCenterBeanDefinitionParserTag.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2016-2018 shardingsphere.io. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *

- */ - -package io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * Etcd registry center parser tag constants. - * - * @author zhangliang - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class EtcdRegistryCenterBeanDefinitionParserTag { - - public static final String ROOT_TAG = "etcd"; - - public static final String SERVER_LISTS_TAG = "server-lists"; - - public static final String OPERATION_TIMEOUT_MILLISECONDS_TAG = "operation-timeout-milliseconds"; - - public static final String MAX_RETRIES_TAG = "max-retries"; - - public static final String RETRY_INTERVAL_MILLISECONDS_TAG = "retry-interval-milliseconds"; - - public static final String TIME_TO_LIVE_SECONDS_TAG = "time-to-live-seconds"; -} diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/ZookeeperRegistryCenterBeanDefinitionParserTag.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/RegistryCenterBeanDefinitionParserTag.java similarity index 88% rename from sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/ZookeeperRegistryCenterBeanDefinitionParserTag.java rename to sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/RegistryCenterBeanDefinitionParserTag.java index ad1035bd9ce46..a5f899e036ed5 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/ZookeeperRegistryCenterBeanDefinitionParserTag.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/constants/RegistryCenterBeanDefinitionParserTag.java @@ -21,14 +21,14 @@ import lombok.NoArgsConstructor; /** - * Zookeeper registry center parser tag constants. + * Registry center parser tag constants. * * @author caohao */ @NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class ZookeeperRegistryCenterBeanDefinitionParserTag { +public final class RegistryCenterBeanDefinitionParserTag { - public static final String ROOT_TAG = "zookeeper"; + public static final String ROOT_TAG = "registry-center"; public static final String SERVER_LISTS_TAG = "server-lists"; diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/handler/OrchestrationNamespaceHandler.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/handler/OrchestrationNamespaceHandler.java index 4236a982c1fbc..85459d8eee087 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/handler/OrchestrationNamespaceHandler.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/handler/OrchestrationNamespaceHandler.java @@ -17,10 +17,9 @@ package io.shardingsphere.shardingjdbc.orchestration.spring.namespace.handler; -import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.EtcdRegistryCenterBeanDefinitionParserTag; import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.MasterSlaveDataSourceBeanDefinitionParserTag; +import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.RegistryCenterBeanDefinitionParserTag; import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.ShardingDataSourceBeanDefinitionParserTag; -import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.ZookeeperRegistryCenterBeanDefinitionParserTag; import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.parser.DataSourceBeanDefinitionParser; import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.parser.RegBeanDefinitionParser; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; @@ -34,8 +33,7 @@ public final class OrchestrationNamespaceHandler extends NamespaceHandlerSupport @Override public void init() { - registerBeanDefinitionParser(ZookeeperRegistryCenterBeanDefinitionParserTag.ROOT_TAG, new RegBeanDefinitionParser()); - registerBeanDefinitionParser(EtcdRegistryCenterBeanDefinitionParserTag.ROOT_TAG, new RegBeanDefinitionParser()); + registerBeanDefinitionParser(RegistryCenterBeanDefinitionParserTag.ROOT_TAG, new RegBeanDefinitionParser()); registerBeanDefinitionParser(ShardingDataSourceBeanDefinitionParserTag.ROOT_TAG, new DataSourceBeanDefinitionParser()); registerBeanDefinitionParser(MasterSlaveDataSourceBeanDefinitionParserTag.ROOT_TAG, new DataSourceBeanDefinitionParser()); } diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java index ee16039d70ae9..5fdc813076bb0 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/java/io/shardingsphere/shardingjdbc/orchestration/spring/namespace/parser/RegBeanDefinitionParser.java @@ -18,10 +18,8 @@ package io.shardingsphere.shardingjdbc.orchestration.spring.namespace.parser; import com.google.common.base.Strings; -import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; -import io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration; -import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.EtcdRegistryCenterBeanDefinitionParserTag; -import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.ZookeeperRegistryCenterBeanDefinitionParserTag; +import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; +import io.shardingsphere.shardingjdbc.orchestration.spring.namespace.constants.RegistryCenterBeanDefinitionParserTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; @@ -37,28 +35,14 @@ public final class RegBeanDefinitionParser extends AbstractBeanDefinitionParser @Override protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext parserContext) { - return ZookeeperRegistryCenterBeanDefinitionParserTag.ROOT_TAG.equals(element.getLocalName()) ? getZookeeperConfiguration(element) : getEtcdConfiguration(element); - } - - private AbstractBeanDefinition getZookeeperConfiguration(final Element element) { - BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(CuratorZookeeperConfiguration.class); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.SERVER_LISTS_TAG, "serverLists", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.NAMESPACE_TAG, "namespace", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.DIGEST_TAG, "digest", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.OPERATION_TIMEOUT_MILLISECONDS_TAG, "operationTimeoutMilliseconds", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.MAX_RETRIES_TAG, "maxRetries", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.RETRY_INTERVAL_MILLISECONDS_TAG, "retryIntervalMilliseconds", element, factory); - addPropertyValueIfNotEmpty(ZookeeperRegistryCenterBeanDefinitionParserTag.TIME_TO_LIVE_SECONDS_TAG, "timeToLiveSeconds", element, factory); - return factory.getBeanDefinition(); - } - - private AbstractBeanDefinition getEtcdConfiguration(final Element element) { - BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(EtcdConfiguration.class); - addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.SERVER_LISTS_TAG, "serverLists", element, factory); - addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.OPERATION_TIMEOUT_MILLISECONDS_TAG, "operationTimeoutMilliseconds", element, factory); - addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.MAX_RETRIES_TAG, "maxRetries", element, factory); - addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.RETRY_INTERVAL_MILLISECONDS_TAG, "retryIntervalMilliseconds", element, factory); - addPropertyValueIfNotEmpty(EtcdRegistryCenterBeanDefinitionParserTag.TIME_TO_LIVE_SECONDS_TAG, "timeToLiveSeconds", element, factory); + BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(RegistryCenterConfiguration.class); + addPropertyValueIfNotEmpty(RegistryCenterBeanDefinitionParserTag.SERVER_LISTS_TAG, "serverLists", element, factory); + addPropertyValueIfNotEmpty(RegistryCenterBeanDefinitionParserTag.NAMESPACE_TAG, "namespace", element, factory); + addPropertyValueIfNotEmpty(RegistryCenterBeanDefinitionParserTag.DIGEST_TAG, "digest", element, factory); + addPropertyValueIfNotEmpty(RegistryCenterBeanDefinitionParserTag.OPERATION_TIMEOUT_MILLISECONDS_TAG, "operationTimeoutMilliseconds", element, factory); + addPropertyValueIfNotEmpty(RegistryCenterBeanDefinitionParserTag.MAX_RETRIES_TAG, "maxRetries", element, factory); + addPropertyValueIfNotEmpty(RegistryCenterBeanDefinitionParserTag.RETRY_INTERVAL_MILLISECONDS_TAG, "retryIntervalMilliseconds", element, factory); + addPropertyValueIfNotEmpty(RegistryCenterBeanDefinitionParserTag.TIME_TO_LIVE_SECONDS_TAG, "timeToLiveSeconds", element, factory); return factory.getBeanDefinition(); } diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd index c16a63465bea3..df8db19275024 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd @@ -21,7 +21,7 @@ - + @@ -36,17 +36,4 @@ - - - - - - - - - - - - - diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/io/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/io/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java index 03e2a117b532f..5feb34b66d37e 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/io/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/java/io/shardingsphere/shardingjdbc/orchestration/spring/util/EmbedTestingServer.java @@ -17,10 +17,12 @@ package io.shardingsphere.shardingjdbc.orchestration.spring.util; -import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperExceptionHandler; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.curator.test.TestingServer; +import org.apache.zookeeper.KeeperException.ConnectionLossException; +import org.apache.zookeeper.KeeperException.NoNodeException; +import org.apache.zookeeper.KeeperException.NodeExistsException; import java.io.File; import java.io.IOException; @@ -41,22 +43,25 @@ public static void start() { } try { testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); - // CHECKSTYLE:OFF } catch (final Exception ex) { - // CHECKSTYLE:ON - NativeZookeeperExceptionHandler.handleException(ex); + if (!isIgnoredException(ex)) { + throw new RuntimeException(ex); + } } finally { Runtime.getRuntime().addShutdownHook(new Thread() { - + @Override public void run() { try { testingServer.close(); - } catch (final IOException ex) { - NativeZookeeperExceptionHandler.handleException(ex); + } catch (final IOException ignore) { } } }); } } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof ConnectionLossException || cause instanceof NoNodeException || cause instanceof NodeExistsException; + } } diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml index d9aff6d9280c7..d73d57de7352a 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/masterSlaveOrchestration.xml @@ -8,7 +8,7 @@ http://shardingsphere.io/schema/shardingsphere/orchestration/orchestration.xsd"> - + diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml index 6041e0161ae14..b4cc17854074f 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingMasterSlaveOrchestration.xml @@ -8,7 +8,7 @@ http://shardingsphere.io/schema/shardingsphere/orchestration/orchestration.xsd"> - + diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml index 626ce4264d5bf..271b27d5d1954 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/test/resources/META-INF/rdb/shardingOrchestration.xml @@ -8,7 +8,7 @@ http://shardingsphere.io/schema/shardingsphere/orchestration/orchestration.xsd"> - + diff --git a/sharding-jdbc/sharding-jdbc-orchestration/pom.xml b/sharding-jdbc/sharding-jdbc-orchestration/pom.xml index 5766c5490e216..42e763c18b075 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/pom.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration/pom.xml @@ -23,23 +23,14 @@
io.shardingsphere - sharding-orchestration-reg-zookeeper-curator - ${project.version} - - - io.shardingsphere - sharding-orchestration-reg-native-zookeeper - ${project.version} - - - io.shardingsphere - sharding-orchestration-reg-etcd + sharding-core ${project.version} io.shardingsphere - sharding-core + sharding-orchestration-reg-zookeeper-curator ${project.version} + test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/java/io/shardingsphere/shardingjdbc/orchestration/api/yaml/util/EmbedTestingServer.java b/sharding-jdbc/sharding-jdbc-orchestration/src/test/java/io/shardingsphere/shardingjdbc/orchestration/api/yaml/util/EmbedTestingServer.java index 2efd88553c522..ffed7aadf7d25 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/java/io/shardingsphere/shardingjdbc/orchestration/api/yaml/util/EmbedTestingServer.java +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/java/io/shardingsphere/shardingjdbc/orchestration/api/yaml/util/EmbedTestingServer.java @@ -17,10 +17,12 @@ package io.shardingsphere.shardingjdbc.orchestration.api.yaml.util; -import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperExceptionHandler; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.curator.test.TestingServer; +import org.apache.zookeeper.KeeperException.ConnectionLossException; +import org.apache.zookeeper.KeeperException.NoNodeException; +import org.apache.zookeeper.KeeperException.NodeExistsException; import java.io.File; import java.io.IOException; @@ -41,10 +43,10 @@ public static void start() { } try { testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); - // CHECKSTYLE:OFF } catch (final Exception ex) { - // CHECKSTYLE:ON - NativeZookeeperExceptionHandler.handleException(ex); + if (!isIgnoredException(ex)) { + throw new RuntimeException(ex); + } } finally { Runtime.getRuntime().addShutdownHook(new Thread() { @@ -52,11 +54,14 @@ public static void start() { public void run() { try { testingServer.close(); - } catch (final IOException ex) { - NativeZookeeperExceptionHandler.handleException(ex); + } catch (final IOException ignore) { } } }); - } + } + } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof ConnectionLossException || cause instanceof NoNodeException || cause instanceof NodeExistsException; } } diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/ms/configWithMasterSlaveDataSourceWithProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/ms/configWithMasterSlaveDataSourceWithProps.yaml index 3f8afef2f3103..568d5e58a10e3 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/ms/configWithMasterSlaveDataSourceWithProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/ms/configWithMasterSlaveDataSourceWithProps.yaml @@ -33,6 +33,6 @@ masterSlaveRule: orchestration: name: demo_ds_ms overwrite: true - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/ms/configWithMasterSlaveDataSourceWithoutProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/ms/configWithMasterSlaveDataSourceWithoutProps.yaml index 1ab70185193ac..d9d3667070daa 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/ms/configWithMasterSlaveDataSourceWithoutProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/ms/configWithMasterSlaveDataSourceWithoutProps.yaml @@ -28,6 +28,6 @@ masterSlaveRule: orchestration: name: demo_ds_ms overwrite: true - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithDataSourceWithProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithDataSourceWithProps.yaml index eb4226baa6a86..c03111b6d4ba2 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithDataSourceWithProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithDataSourceWithProps.yaml @@ -56,6 +56,6 @@ shardingRule: orchestration: name: demo_ds_ms overwrite: true - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithDataSourceWithoutProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithDataSourceWithoutProps.yaml index 10c25bf1b5657..772042c3cb3ce 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithDataSourceWithoutProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithDataSourceWithoutProps.yaml @@ -53,6 +53,6 @@ shardingRule: orchestration: name: demo_ds_ms overwrite: true - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithoutDataSourceWithProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithoutDataSourceWithProps.yaml index a80ff2ab8a671..ac10e5d4ab7aa 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithoutDataSourceWithProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithoutDataSourceWithProps.yaml @@ -42,6 +42,6 @@ shardingRule: orchestration: name: demo_ds_ms overwrite: true - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithoutDataSourceWithoutProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithoutDataSourceWithoutProps.yaml index 2f932aad39287..a94deef1f8250 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithoutDataSourceWithoutProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding/configWithoutDataSourceWithoutProps.yaml @@ -36,6 +36,6 @@ shardingRule: orchestration: name: demo_ds_ms - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithDataSourceWithProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithDataSourceWithProps.yaml index 44fbbafc2b839..ad33b465c42e3 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithDataSourceWithProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithDataSourceWithProps.yaml @@ -79,6 +79,6 @@ shardingRule: orchestration: name: demo_ds_ms overwrite: true - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithDataSourceWithoutProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithDataSourceWithoutProps.yaml index 677be65c7d946..b8fb93dde80d0 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithDataSourceWithoutProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithDataSourceWithoutProps.yaml @@ -77,6 +77,6 @@ shardingRule: orchestration: name: demo_ds_ms overwrite: true - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithoutDataSourceWithProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithoutDataSourceWithProps.yaml index 15a08f85f64a7..17d10719b6794 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithoutDataSourceWithProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithoutDataSourceWithProps.yaml @@ -50,6 +50,6 @@ shardingRule: orchestration: name: demo_ds_ms overwrite: true - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithoutDataSourceWithoutProps.yaml b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithoutDataSourceWithoutProps.yaml index f222bbe776426..0644710a561db 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithoutDataSourceWithoutProps.yaml +++ b/sharding-jdbc/sharding-jdbc-orchestration/src/test/resources/yaml/integrate/sharding_ms/configWithoutDataSourceWithoutProps.yaml @@ -49,6 +49,6 @@ shardingRule: orchestration: name: demo_ds_ms - zookeeper: - namespace: orchestration-yaml-test + registry: serverLists: localhost:3181 + namespace: orchestration-yaml-test diff --git a/sharding-orchestration/sharding-orchestration-core/pom.xml b/sharding-orchestration/sharding-orchestration-core/pom.xml index 679597d763014..e5edc415a25d4 100644 --- a/sharding-orchestration/sharding-orchestration-core/pom.xml +++ b/sharding-orchestration/sharding-orchestration-core/pom.xml @@ -13,28 +13,20 @@ io.shardingsphere - sharding-orchestration-reg-api - ${project.version} - - - io.shardingsphere - sharding-orchestration-reg-zookeeper-curator - ${project.version} - - - io.shardingsphere - sharding-orchestration-reg-native-zookeeper + sharding-core ${project.version} io.shardingsphere - sharding-orchestration-reg-etcd + sharding-orchestration-reg-api ${project.version} + io.shardingsphere - sharding-core + sharding-orchestration-reg-zookeeper-curator ${project.version} + test diff --git a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java index 8a6965f0aadeb..5b4690e9af0aa 100644 --- a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java +++ b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/internal/OrchestrationFacade.java @@ -30,12 +30,6 @@ import io.shardingsphere.orchestration.internal.state.instance.InstanceStateService; import io.shardingsphere.orchestration.reg.api.RegistryCenter; import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; -import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; -import io.shardingsphere.orchestration.reg.etcd.EtcdRegistryCenter; -import io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration; -import io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperRegistryCenter; -import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperConfiguration; -import io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperRegistryCenter; import io.shardingsphere.shardingjdbc.jdbc.core.datasource.MasterSlaveDataSource; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -45,6 +39,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Properties; +import java.util.ServiceLoader; /** * Orchestration service facade. @@ -70,7 +65,7 @@ public final class OrchestrationFacade implements AutoCloseable { private final RegistryCenter regCenter; public OrchestrationFacade(final OrchestrationConfiguration orchestrationConfig) { - regCenter = createRegistryCenter(orchestrationConfig.getRegCenterConfig()); + regCenter = loadRegistryCenter(orchestrationConfig.getRegCenterConfig()); isOverwrite = orchestrationConfig.isOverwrite(); configService = new ConfigurationService(orchestrationConfig.getName(), regCenter); instanceStateService = new InstanceStateService(orchestrationConfig.getName(), regCenter); @@ -78,18 +73,20 @@ public OrchestrationFacade(final OrchestrationConfiguration orchestrationConfig) listenerManager = new ListenerFactory(orchestrationConfig.getName(), regCenter); } - private RegistryCenter createRegistryCenter(final RegistryCenterConfiguration regCenterConfig) { + private RegistryCenter loadRegistryCenter(final RegistryCenterConfiguration regCenterConfig) { Preconditions.checkNotNull(regCenterConfig, "Registry center configuration cannot be null."); - if (regCenterConfig instanceof CuratorZookeeperConfiguration) { - return new CuratorZookeeperRegistryCenter((CuratorZookeeperConfiguration) regCenterConfig); + RegistryCenter result = null; + int count = 0; + for (RegistryCenter each : ServiceLoader.load(RegistryCenter.class)) { + result = each; + count++; } - if (regCenterConfig instanceof NativeZookeeperConfiguration) { - return new NativeZookeeperRegistryCenter((NativeZookeeperConfiguration) regCenterConfig); + Preconditions.checkNotNull(result, "Cannot load implementation class for `RegistryCenter`"); + if (1 != count) { + log.warn("Find more than one RegistryCenter implementation class, use `{}` now", result.getClass().getName()); } - if (regCenterConfig instanceof EtcdConfiguration) { - return new EtcdRegistryCenter((EtcdConfiguration) regCenterConfig); - } - throw new UnsupportedOperationException(regCenterConfig.getClass().getName()); + result.init(regCenterConfig); + return result; } /** diff --git a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java index fca5b9c1a818e..1eadab5c6f657 100644 --- a/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-core/src/main/java/io/shardingsphere/orchestration/yaml/YamlOrchestrationConfiguration.java @@ -19,8 +19,7 @@ import com.google.common.base.Preconditions; import io.shardingsphere.orchestration.config.OrchestrationConfiguration; -import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; -import io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperConfiguration; +import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; import lombok.Getter; import lombok.Setter; @@ -36,9 +35,7 @@ public class YamlOrchestrationConfiguration { private String name; - private EtcdConfiguration etcd; - - private CuratorZookeeperConfiguration zookeeper; + private RegistryCenterConfiguration registry; private boolean overwrite; @@ -48,7 +45,7 @@ public class YamlOrchestrationConfiguration { * @return orchestration master-slave rule configuration from yaml */ public OrchestrationConfiguration getOrchestrationConfiguration() { - Preconditions.checkState(null == etcd || null == zookeeper, "Can't config both zookeeper and etcd as registry center!"); - return new OrchestrationConfiguration(getName(), null != etcd ? etcd : zookeeper, overwrite); + Preconditions.checkState(null != registry, "Registry center must be required!"); + return new OrchestrationConfiguration(getName(), registry, overwrite); } } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenter.java index 58939d02a4b07..9aa573dc1fcf3 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenter.java @@ -28,6 +28,13 @@ */ public interface RegistryCenter extends AutoCloseable { + /** + * Initialize registry center. + * + * @param config registry center configuration + */ + void init(RegistryCenterConfiguration config); + /** * Get data from registry center. * diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java index 22d901cb8b6d3..ed4151a2f52d6 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/api/RegistryCenterConfiguration.java @@ -17,59 +17,50 @@ package io.shardingsphere.orchestration.reg.api; +import lombok.Getter; +import lombok.Setter; + /** * Registry center configuration. * * @author zhangliang */ -public interface RegistryCenterConfiguration { +@Getter +@Setter +public final class RegistryCenterConfiguration { /** - * Get server list of registry center. - * - * @return server list of registry center + * Server list of registry center. */ - String getServerLists(); + private String serverLists; /** - * Get namespace of registry center. - * - * @return namespace of registry center + * Namespace of registry center. */ - String getNamespace(); + private String namespace; /** - * Get digest of registry center. - * - * @return digest of registry center + * Digest of registry center. */ - String getDigest(); + private String digest; /** - * Get operation timeout time in milliseconds. - * - * @return operation timeout time in milliseconds + * Operation timeout time in milliseconds. */ - int getOperationTimeoutMilliseconds(); + private int operationTimeoutMilliseconds = 500; /** - * Get max number of times to retry. - * - * @return max number of times to retry + * Max number of times to retry. */ - int getMaxRetries(); + private int maxRetries = 3; /** - * Get time interval in milliseconds on each retry. - * - * @return time interval in milliseconds on each retry + * Time interval in milliseconds on each retry. */ - int getRetryIntervalMilliseconds(); + private int retryIntervalMilliseconds = 500; /** - * Get time to live in seconds of ephemeral keys. - * - * @return time to live in seconds of ephemeral keys + * Time to live in seconds of ephemeral keys. */ - int getTimeToLiveSeconds(); + private int timeToLiveSeconds = 60; } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/listener/DataChangedEvent.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/listener/DataChangedEvent.java index 6437354d58098..d8164bae24d03 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/listener/DataChangedEvent.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/src/main/java/io/shardingsphere/orchestration/reg/listener/DataChangedEvent.java @@ -27,7 +27,7 @@ */ @RequiredArgsConstructor @Getter -public class DataChangedEvent { +public final class DataChangedEvent { private final Type eventType; diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java deleted file mode 100644 index aae574da7bb97..0000000000000 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdConfiguration.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2016-2018 shardingsphere.io. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *

- */ - -package io.shardingsphere.orchestration.reg.etcd; - -import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; -import lombok.Getter; -import lombok.Setter; - -/** - * Registry center configuration for etcd. - * - * @author junxiong - */ -@Getter -@Setter -public final class EtcdConfiguration implements RegistryCenterConfiguration { - - /** - * Etcd server list. - * - *

Include ip address and port, multiple servers split by comma. Etc: {@code http://host1:2379,http://host2:2379}

- */ - private String serverLists; - - private int operationTimeoutMilliseconds = 500; - - private int maxRetries = 3; - - private int retryIntervalMilliseconds = 200; - - private int timeToLiveSeconds = 60; - - @Override - public String getNamespace() { - throw new UnsupportedOperationException("Cannot support namespace on ETCD"); - } - - @Override - public String getDigest() { - throw new UnsupportedOperationException("Cannot support digest on ETCD"); - } -} diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java index 73e76e6ef57d4..b147d6eb9a046 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/EtcdRegistryCenter.java @@ -18,6 +18,7 @@ package io.shardingsphere.orchestration.reg.etcd; import com.google.common.base.Optional; +import com.google.common.base.Splitter; import com.google.protobuf.ByteString; import etcdserverpb.KVGrpc; import etcdserverpb.KVGrpc.KVFutureStub; @@ -33,6 +34,7 @@ import etcdserverpb.WatchGrpc.WatchStub; import io.grpc.Channel; import io.shardingsphere.orchestration.reg.api.RegistryCenter; +import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; import io.shardingsphere.orchestration.reg.etcd.internal.channel.EtcdChannelFactory; import io.shardingsphere.orchestration.reg.etcd.internal.keepalive.KeepAlive; import io.shardingsphere.orchestration.reg.etcd.internal.retry.EtcdRetryEngine; @@ -57,26 +59,27 @@ */ public final class EtcdRegistryCenter implements RegistryCenter { - private final EtcdConfiguration etcdConfig; + private RegistryCenterConfiguration config; - private final EtcdRetryEngine etcdRetryEngine; + private EtcdRetryEngine etcdRetryEngine; - private final KVFutureStub kvStub; + private KVFutureStub kvStub; - private final LeaseFutureStub leaseStub; + private LeaseFutureStub leaseStub; - private final WatchStub watchStub; + private WatchStub watchStub; - private final KeepAlive keepAlive; + private KeepAlive keepAlive; - public EtcdRegistryCenter(final EtcdConfiguration etcdConfig) { - this.etcdConfig = etcdConfig; - etcdRetryEngine = new EtcdRetryEngine(etcdConfig); - Channel channel = EtcdChannelFactory.getInstance(Arrays.asList(etcdConfig.getServerLists().split(","))); + @Override + public void init(final RegistryCenterConfiguration config) { + this.config = config; + etcdRetryEngine = new EtcdRetryEngine(config); + Channel channel = EtcdChannelFactory.getInstance(Splitter.on(',').trimResults().splitToList(config.getServerLists())); kvStub = KVGrpc.newFutureStub(channel); leaseStub = LeaseGrpc.newFutureStub(channel); watchStub = WatchGrpc.newStub(channel); - keepAlive = new KeepAlive(channel, etcdConfig.getTimeToLiveSeconds()); + keepAlive = new KeepAlive(channel, config.getTimeToLiveSeconds()); } @Override @@ -86,7 +89,7 @@ public String get(final String key) { @Override public String call() throws InterruptedException, ExecutionException, TimeoutException { - RangeResponse response = kvStub.range(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); + RangeResponse response = kvStub.range(request).get(config.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); return response.getKvsCount() > 0 ? response.getKvs(0).getValue().toStringUtf8() : null; } }).orNull(); @@ -110,7 +113,7 @@ public List getChildrenKeys(final String key) { @Override public List call() throws InterruptedException, ExecutionException, TimeoutException { - RangeResponse response = kvStub.range(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); + RangeResponse response = kvStub.range(request).get(config.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); List result = new ArrayList<>(); for (KeyValue each : response.getKvsList()) { String childFullPath = each.getKey().toStringUtf8(); @@ -129,7 +132,7 @@ public void persist(final String key, final String value) { @Override public Void call() throws InterruptedException, ExecutionException, TimeoutException { - kvStub.put(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); + kvStub.put(request).get(config.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); return null; } }); @@ -151,19 +154,19 @@ public void persistEphemeral(final String key, final String value) { @Override public Void call() throws InterruptedException, ExecutionException, TimeoutException { - kvStub.put(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); + kvStub.put(request).get(config.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS); return null; } }); } private Optional lease() { - final LeaseGrantRequest request = LeaseGrantRequest.newBuilder().setTTL(etcdConfig.getTimeToLiveSeconds()).build(); + final LeaseGrantRequest request = LeaseGrantRequest.newBuilder().setTTL(config.getTimeToLiveSeconds()).build(); return etcdRetryEngine.execute(new Callable() { @Override public Long call() throws InterruptedException, ExecutionException, TimeoutException { - long leaseId = leaseStub.leaseGrant(request).get(etcdConfig.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS).getID(); + long leaseId = leaseStub.leaseGrant(request).get(config.getOperationTimeoutMilliseconds(), TimeUnit.MILLISECONDS).getID(); keepAlive.heartbeat(leaseId); return leaseId; } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java index 9827286711596..0b24283a140aa 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/java/io/shardingsphere/orchestration/reg/etcd/internal/retry/EtcdRetryEngine.java @@ -23,7 +23,7 @@ import com.github.rholder.retry.StopStrategies; import com.github.rholder.retry.WaitStrategies; import com.google.common.base.Optional; -import io.shardingsphere.orchestration.reg.etcd.EtcdConfiguration; +import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; import io.shardingsphere.orchestration.reg.exception.RegistryCenterException; import lombok.RequiredArgsConstructor; @@ -40,7 +40,7 @@ @RequiredArgsConstructor public final class EtcdRetryEngine { - private final EtcdConfiguration etcdConfig; + private final RegistryCenterConfiguration config; /** * Retry to execute callable command. @@ -54,8 +54,8 @@ public Optional execute(final Callable callable) { .retryIfExceptionOfType(TimeoutException.class) .retryIfExceptionOfType(ExecutionException.class) .retryIfExceptionOfType(InterruptedException.class) - .withWaitStrategy(WaitStrategies.fixedWait(etcdConfig.getRetryIntervalMilliseconds(), TimeUnit.MILLISECONDS)) - .withStopStrategy(StopStrategies.stopAfterAttempt(etcdConfig.getMaxRetries())) + .withWaitStrategy(WaitStrategies.fixedWait(config.getRetryIntervalMilliseconds(), TimeUnit.MILLISECONDS)) + .withStopStrategy(StopStrategies.stopAfterAttempt(config.getMaxRetries())) .build(); try { return Optional.fromNullable(retryer.call(callable)); diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter new file mode 100644 index 0000000000000..044b1c669c127 --- /dev/null +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter @@ -0,0 +1 @@ +io.shardingsphere.orchestration.reg.etcd.EtcdRegistryCenter diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperConfiguration.java deleted file mode 100644 index 3715dab9ea217..0000000000000 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperConfiguration.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2016-2018 shardingsphere.io. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *

- */ - -package io.shardingsphere.orchestration.reg.zookeeper.natived; - -import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; -import lombok.Getter; -import lombok.Setter; - -/** - * Registry center configuration for native zookeeper. - * - * @author zhangliang - */ -@Getter -@Setter -public final class NativeZookeeperConfiguration implements RegistryCenterConfiguration { - - /** - * Zookeeper server list. - * - *

Include ip address and port, multiple servers split by comma. Etc: {@code host1:2181,host2:2181}

- */ - private String serverLists; - - private String namespace; - - /** - * Default is not need digest. - */ - private String digest; - - private int operationTimeoutMilliseconds; - - private int maxRetries = 3; - - private int retryIntervalMilliseconds = 1000; - - private int timeToLiveSeconds = 60; -} diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperRegistryCenter.java index 4e92bb22581fe..2cc8ba1224b52 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/natived/NativeZookeeperRegistryCenter.java @@ -21,6 +21,7 @@ import com.google.common.base.Optional; import com.google.common.base.Strings; import io.shardingsphere.orchestration.reg.api.RegistryCenter; +import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; import io.shardingsphere.orchestration.reg.listener.DataChangedEvent; import io.shardingsphere.orchestration.reg.listener.EventListener; import io.shardingsphere.orchestration.reg.zookeeper.natived.client.action.IClient; @@ -51,16 +52,16 @@ */ public final class NativeZookeeperRegistryCenter implements RegistryCenter { - private final IClient client; + private final Map caches = new HashMap<>(); - private final Map caches; + private IClient client; - public NativeZookeeperRegistryCenter(final NativeZookeeperConfiguration zkConfig) { - client = initClient(buildClientFactory(zkConfig), zkConfig); - caches = new HashMap<>(); + @Override + public void init(final RegistryCenterConfiguration config) { + client = initClient(buildClientFactory(config), config); } - private ClientFactory buildClientFactory(final NativeZookeeperConfiguration config) { + private ClientFactory buildClientFactory(final RegistryCenterConfiguration config) { ClientFactory result = new ClientFactory(); result.setClientNamespace(config.getNamespace()).newClient(config.getServerLists(), config.getTimeToLiveSeconds() * 1000) .setRetryPolicy(new DelayRetryPolicy(config.getRetryIntervalMilliseconds(), config.getMaxRetries(), config.getRetryIntervalMilliseconds())); @@ -70,13 +71,13 @@ private ClientFactory buildClientFactory(final NativeZookeeperConfiguration conf return result; } - private IClient initClient(final ClientFactory clientFactory, final NativeZookeeperConfiguration zkConfig) { + private IClient initClient(final ClientFactory clientFactory, final RegistryCenterConfiguration config) { IClient result = null; try { // TODO There is a bug when the start time is very short, and I haven't found the reason yet - // result = clientFactory.start(zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS); + // result = clientFactory.start(config.getRetryIntervalMilliseconds() * config.getMaxRetries(), TimeUnit.MILLISECONDS); result = clientFactory.start(); - if (!result.blockUntilConnected(zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS)) { + if (!result.blockUntilConnected(config.getRetryIntervalMilliseconds() * config.getMaxRetries(), TimeUnit.MILLISECONDS)) { result.close(); throw new KeeperException.OperationTimeoutException(); } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter new file mode 100644 index 0000000000000..9db828e8a6738 --- /dev/null +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter @@ -0,0 +1 @@ +io.shardingsphere.orchestration.reg.zookeeper.natived.NativeZookeeperRegistryCenter diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperConfiguration.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperConfiguration.java deleted file mode 100644 index 21bb36580e5e4..0000000000000 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperConfiguration.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2016-2018 shardingsphere.io. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *

- */ - -package io.shardingsphere.orchestration.reg.zookeeper.curator; - -import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; -import lombok.Getter; -import lombok.Setter; - -/** - * Registry center configuration for zookeeper with curator. - * - * @author zhangliang - */ -@Getter -@Setter -public final class CuratorZookeeperConfiguration implements RegistryCenterConfiguration { - - /** - * Zookeeper server list. - * - *

Include ip address and port, multiple servers split by comma. Etc: {@code host1:2181,host2:2181}

- */ - private String serverLists; - - private String namespace; - - /** - * Default is not need digest. - */ - private String digest; - - private int operationTimeoutMilliseconds; - - private int maxRetries = 3; - - private int retryIntervalMilliseconds = 1000; - - private int timeToLiveSeconds = 60; -} diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperRegistryCenter.java b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperRegistryCenter.java index d6f11489884eb..f6e1edd2dee62 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperRegistryCenter.java +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/java/io/shardingsphere/orchestration/reg/zookeeper/curator/CuratorZookeeperRegistryCenter.java @@ -20,6 +20,7 @@ import com.google.common.base.Charsets; import com.google.common.base.Strings; import io.shardingsphere.orchestration.reg.api.RegistryCenter; +import io.shardingsphere.orchestration.reg.api.RegistryCenterConfiguration; import io.shardingsphere.orchestration.reg.listener.DataChangedEvent; import io.shardingsphere.orchestration.reg.listener.EventListener; import org.apache.curator.framework.CuratorFramework; @@ -52,28 +53,29 @@ */ public final class CuratorZookeeperRegistryCenter implements RegistryCenter { - private final CuratorFramework client; - private final Map caches = new HashMap<>(); - public CuratorZookeeperRegistryCenter(final CuratorZookeeperConfiguration zkConfig) { - client = buildCuratorClient(zkConfig); - initCuratorClient(zkConfig); + private CuratorFramework client; + + @Override + public void init(final RegistryCenterConfiguration config) { + client = buildCuratorClient(config); + initCuratorClient(config); } - private CuratorFramework buildCuratorClient(final CuratorZookeeperConfiguration zkConfig) { + private CuratorFramework buildCuratorClient(final RegistryCenterConfiguration config) { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder() - .connectString(zkConfig.getServerLists()) - .retryPolicy(new ExponentialBackoffRetry(zkConfig.getRetryIntervalMilliseconds(), zkConfig.getMaxRetries(), zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries())) - .namespace(zkConfig.getNamespace()); - if (0 != zkConfig.getTimeToLiveSeconds()) { - builder.sessionTimeoutMs(zkConfig.getTimeToLiveSeconds() * 1000); + .connectString(config.getServerLists()) + .retryPolicy(new ExponentialBackoffRetry(config.getRetryIntervalMilliseconds(), config.getMaxRetries(), config.getRetryIntervalMilliseconds() * config.getMaxRetries())) + .namespace(config.getNamespace()); + if (0 != config.getTimeToLiveSeconds()) { + builder.sessionTimeoutMs(config.getTimeToLiveSeconds() * 1000); } - if (0 != zkConfig.getOperationTimeoutMilliseconds()) { - builder.connectionTimeoutMs(zkConfig.getOperationTimeoutMilliseconds()); + if (0 != config.getOperationTimeoutMilliseconds()) { + builder.connectionTimeoutMs(config.getOperationTimeoutMilliseconds()); } - if (!Strings.isNullOrEmpty(zkConfig.getDigest())) { - builder.authorization("digest", zkConfig.getDigest().getBytes(Charsets.UTF_8)) + if (!Strings.isNullOrEmpty(config.getDigest())) { + builder.authorization("digest", config.getDigest().getBytes(Charsets.UTF_8)) .aclProvider(new ACLProvider() { @Override @@ -90,10 +92,10 @@ public List getAclForPath(final String path) { return builder.build(); } - private void initCuratorClient(final CuratorZookeeperConfiguration zkConfig) { + private void initCuratorClient(final RegistryCenterConfiguration config) { client.start(); try { - if (!client.blockUntilConnected(zkConfig.getRetryIntervalMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS)) { + if (!client.blockUntilConnected(config.getRetryIntervalMilliseconds() * config.getMaxRetries(), TimeUnit.MILLISECONDS)) { client.close(); throw new OperationTimeoutException(); } diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter new file mode 100644 index 0000000000000..a3141c0e381b4 --- /dev/null +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/src/main/resources/META-INF/services/io.shardingsphere.orchestration.reg.api.RegistryCenter @@ -0,0 +1 @@ +io.shardingsphere.orchestration.reg.zookeeper.curator.CuratorZookeeperRegistryCenter diff --git a/sharding-proxy/src/main/resources/conf/server.yaml b/sharding-proxy/src/main/resources/conf/server.yaml index a4cc257e916a9..adc2e1b20bdcd 100644 --- a/sharding-proxy/src/main/resources/conf/server.yaml +++ b/sharding-proxy/src/main/resources/conf/server.yaml @@ -7,9 +7,9 @@ #orchestration: # name: orchestration_ds # overwrite: true -# zookeeper: -# namespace: orchestration +# registry: # serverLists: localhost:2181 +# namespace: orchestration # #authentication: # username: root diff --git a/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoaderTest.java b/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoaderTest.java index 80df8e35e1bce..ed02f5494dabd 100644 --- a/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoaderTest.java +++ b/sharding-proxy/src/test/java/io/shardingsphere/shardingproxy/config/ShardingConfigurationLoaderTest.java @@ -46,9 +46,8 @@ public void assertLoad() throws IOException { private void assertOrchestrationConfiguration(final YamlOrchestrationConfiguration actual) { assertThat(actual.getName(), is("orchestration_ds")); assertTrue(actual.isOverwrite()); - assertThat(actual.getZookeeper().getNamespace(), is("orchestration")); - assertThat(actual.getZookeeper().getServerLists(), is("localhost:2181")); - assertNull(actual.getEtcd()); + assertThat(actual.getRegistry().getNamespace(), is("orchestration")); + assertThat(actual.getRegistry().getServerLists(), is("localhost:2181")); } private void assertShardingRuleConfiguration(final ProxyYamlRuleConfiguration actual) { diff --git a/sharding-proxy/src/test/resources/conf/server.yaml b/sharding-proxy/src/test/resources/conf/server.yaml index cdfa291185d7f..5c630f322113c 100644 --- a/sharding-proxy/src/test/resources/conf/server.yaml +++ b/sharding-proxy/src/test/resources/conf/server.yaml @@ -1,9 +1,9 @@ orchestration: name: orchestration_ds overwrite: true - zookeeper: - namespace: orchestration + registry: serverLists: localhost:2181 + namespace: orchestration authentication: username: root From b1fab3c8a5dbec3c349d7518b957a60e34792e12 Mon Sep 17 00:00:00 2001 From: terrymanu Date: Wed, 17 Oct 2018 18:32:05 +0800 Subject: [PATCH 27/30] for #1215, registry namespace is optional of spring namespace --- .../src/main/resources/META-INF/namespace/orchestration.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd index df8db19275024..fa8503c8cbfce 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/src/main/resources/META-INF/namespace/orchestration.xsd @@ -26,7 +26,7 @@ - + From 91ad664446cd05dc31adf392aa054ae5883050e0 Mon Sep 17 00:00:00 2001 From: terrymanu Date: Wed, 17 Oct 2018 18:33:57 +0800 Subject: [PATCH 28/30] for #1215, use zk with curator with proxy --- sharding-proxy/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sharding-proxy/pom.xml b/sharding-proxy/pom.xml index 2aa359ee26a5b..b10e89d04e55d 100644 --- a/sharding-proxy/pom.xml +++ b/sharding-proxy/pom.xml @@ -27,6 +27,11 @@ sharding-orchestration-core ${project.version}
+ + io.shardingsphere + sharding-orchestration-reg-zookeeper-curator + ${project.version} + io.shardingsphere sharding-opentracing From e9f4ef182f6cb0ca73e8725840f9a4c1fbbeebea Mon Sep 17 00:00:00 2001 From: terrymanu Date: Wed, 17 Oct 2018 23:37:51 +0800 Subject: [PATCH 29/30] for #1215, comb dependencies --- pom.xml | 8 ++++- .../sharding-orchestration-reg/pom.xml | 36 ------------------- .../sharding-orchestration-reg-etcd/pom.xml | 17 +++++++++ .../pom.xml | 10 ++++++ .../pom.xml | 13 +++++++ 5 files changed, 47 insertions(+), 37 deletions(-) diff --git a/pom.xml b/pom.xml index 7f536e2bc47b7..90ff6cf7bc93a 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,8 @@ 1.1 4.0.4 - + + 3.4.6 2.10.0 1.7.0 3.4.0 @@ -153,6 +154,11 @@ ${atomikos.version} + + org.apache.zookeeper + zookeeper + ${zookeeper.version} + org.apache.curator curator-framework diff --git a/sharding-orchestration/sharding-orchestration-reg/pom.xml b/sharding-orchestration/sharding-orchestration-reg/pom.xml index ccecfe1521132..fbc107a0983bb 100644 --- a/sharding-orchestration/sharding-orchestration-reg/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/pom.xml @@ -17,40 +17,4 @@ sharding-orchestration-reg-native-zookeeper sharding-orchestration-reg-etcd - - - - org.apache.curator - curator-framework - - - org.apache.curator - curator-client - - - org.apache.curator - curator-recipes - - - io.grpc - grpc-netty - - - io.grpc - grpc-protobuf - - - io.grpc - grpc-stub - - - com.github.rholder - guava-retrying - - - - org.apache.curator - curator-test - - diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml index ab21e5a45c83f..b0d4c691d0fe5 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml @@ -16,5 +16,22 @@ sharding-orchestration-reg-api ${project.version} + + + io.grpc + grpc-netty + + + io.grpc + grpc-protobuf + + + io.grpc + grpc-stub + + + com.github.rholder + guava-retrying +
diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml index a57e6b54cc6ef..933956bca0991 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml @@ -16,5 +16,15 @@ sharding-orchestration-reg-api ${project.version}
+ + + org.apache.zookeeper + zookeeper + + + + org.apache.curator + curator-test +
diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml index 8e5dffe4e53da..e200cd8ee2468 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml @@ -16,5 +16,18 @@ sharding-orchestration-reg-api ${project.version} + + + org.apache.curator + curator-framework + + + org.apache.curator + curator-client + + + org.apache.curator + curator-recipes + From 837a2925a38a6784908f62ada033e7945fc0cf00 Mon Sep 17 00:00:00 2001 From: terrymanu Date: Thu, 18 Oct 2018 00:07:24 +0800 Subject: [PATCH 30/30] consist for pom --- pom.xml | 6 ++++-- sharding-core/pom.xml | 1 - sharding-jdbc/pom.xml | 4 ++-- sharding-jdbc/sharding-jdbc-core/pom.xml | 6 ++++-- .../sharding-jdbc-orchestration-spring-boot-starter/pom.xml | 5 ++++- .../sharding-jdbc-orchestration-spring-namespace/pom.xml | 5 ++++- sharding-jdbc/sharding-jdbc-orchestration/pom.xml | 2 +- .../sharding-jdbc-spring-boot-starter/pom.xml | 6 +++++- .../sharding-jdbc-spring-namespace/pom.xml | 6 +++++- sharding-opentracing/pom.xml | 1 - sharding-orchestration/pom.xml | 3 +-- sharding-orchestration/sharding-orchestration-core/pom.xml | 4 ++-- sharding-orchestration/sharding-orchestration-reg/pom.xml | 4 ++-- .../sharding-orchestration-reg-api/pom.xml | 2 +- .../sharding-orchestration-reg-etcd/pom.xml | 2 +- .../sharding-orchestration-reg-native-zookeeper/pom.xml | 2 +- .../sharding-orchestration-reg-zookeeper-curator/pom.xml | 2 +- sharding-proxy/pom.xml | 1 - sharding-sql-test/pom.xml | 3 +-- sharding-transaction/pom.xml | 1 - 20 files changed, 39 insertions(+), 27 deletions(-) diff --git a/pom.xml b/pom.xml index 90ff6cf7bc93a..ada9b7fc5a97a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,12 @@ - + + 4.0.0 io.shardingsphere sharding-sphere 3.0.0.M5-SNAPSHOT pom - ${project.artifactId} sharding-core diff --git a/sharding-core/pom.xml b/sharding-core/pom.xml index b4a964f6f0a9e..23abf663cec1f 100644 --- a/sharding-core/pom.xml +++ b/sharding-core/pom.xml @@ -9,7 +9,6 @@ 3.0.0.M5-SNAPSHOT sharding-core - ${project.artifactId} diff --git a/sharding-jdbc/pom.xml b/sharding-jdbc/pom.xml index c610e04027e97..5915565145014 100644 --- a/sharding-jdbc/pom.xml +++ b/sharding-jdbc/pom.xml @@ -2,12 +2,12 @@ + 4.0.0 - sharding-sphere io.shardingsphere + sharding-sphere 3.0.0.M5-SNAPSHOT - 4.0.0 sharding-jdbc pom diff --git a/sharding-jdbc/sharding-jdbc-core/pom.xml b/sharding-jdbc/sharding-jdbc-core/pom.xml index 2bec1a4d161d6..e817b5f2386c3 100644 --- a/sharding-jdbc/sharding-jdbc-core/pom.xml +++ b/sharding-jdbc/sharding-jdbc-core/pom.xml @@ -1,4 +1,6 @@ - + 4.0.0 @@ -7,7 +9,7 @@ 3.0.0.M5-SNAPSHOT sharding-jdbc-core - ${project.artifactId} + io.shardingsphere diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/pom.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/pom.xml index 2c7ff22538c22..ecd592f709048 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/pom.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-boot-starter/pom.xml @@ -1,4 +1,7 @@ - + + 4.0.0 io.shardingsphere diff --git a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/pom.xml b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/pom.xml index 2c9a346cd48c8..b8d824bea6700 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/pom.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration-spring/sharding-jdbc-orchestration-spring-namespace/pom.xml @@ -1,4 +1,7 @@ - + + 4.0.0 io.shardingsphere diff --git a/sharding-jdbc/sharding-jdbc-orchestration/pom.xml b/sharding-jdbc/sharding-jdbc-orchestration/pom.xml index 42e763c18b075..7cc67cd71dd56 100644 --- a/sharding-jdbc/sharding-jdbc-orchestration/pom.xml +++ b/sharding-jdbc/sharding-jdbc-orchestration/pom.xml @@ -2,12 +2,12 @@ + 4.0.0 io.shardingsphere sharding-jdbc 3.0.0.M5-SNAPSHOT - 4.0.0 sharding-jdbc-orchestration diff --git a/sharding-jdbc/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/pom.xml b/sharding-jdbc/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/pom.xml index ce81ba8a1e8cc..9d546d265045f 100644 --- a/sharding-jdbc/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/pom.xml +++ b/sharding-jdbc/sharding-jdbc-spring/sharding-jdbc-spring-boot-starter/pom.xml @@ -1,4 +1,7 @@ - + + 4.0.0 io.shardingsphere @@ -6,6 +9,7 @@ 3.0.0.M5-SNAPSHOT sharding-jdbc-spring-boot-starter + org.springframework.boot diff --git a/sharding-jdbc/sharding-jdbc-spring/sharding-jdbc-spring-namespace/pom.xml b/sharding-jdbc/sharding-jdbc-spring/sharding-jdbc-spring-namespace/pom.xml index c9ebe57cc3d01..c55e5054642a9 100644 --- a/sharding-jdbc/sharding-jdbc-spring/sharding-jdbc-spring-namespace/pom.xml +++ b/sharding-jdbc/sharding-jdbc-spring/sharding-jdbc-spring-namespace/pom.xml @@ -1,4 +1,7 @@ - + + 4.0.0 io.shardingsphere @@ -6,6 +9,7 @@ 3.0.0.M5-SNAPSHOT sharding-jdbc-spring-namespace + org.springframework diff --git a/sharding-opentracing/pom.xml b/sharding-opentracing/pom.xml index 2a0fdb458d4d6..49200a6d2b801 100644 --- a/sharding-opentracing/pom.xml +++ b/sharding-opentracing/pom.xml @@ -9,7 +9,6 @@ 3.0.0.M5-SNAPSHOT sharding-opentracing - ${project.artifactId} diff --git a/sharding-orchestration/pom.xml b/sharding-orchestration/pom.xml index f99603aaab727..14d21b743b68c 100644 --- a/sharding-orchestration/pom.xml +++ b/sharding-orchestration/pom.xml @@ -2,15 +2,14 @@ + 4.0.0 io.shardingsphere sharding-sphere 3.0.0.M5-SNAPSHOT - 4.0.0 sharding-orchestration pom - ${project.artifactId} sharding-orchestration-core diff --git a/sharding-orchestration/sharding-orchestration-core/pom.xml b/sharding-orchestration/sharding-orchestration-core/pom.xml index e5edc415a25d4..8684a074f7183 100644 --- a/sharding-orchestration/sharding-orchestration-core/pom.xml +++ b/sharding-orchestration/sharding-orchestration-core/pom.xml @@ -2,12 +2,12 @@ + 4.0.0 - sharding-orchestration io.shardingsphere + sharding-orchestration 3.0.0.M5-SNAPSHOT - 4.0.0 sharding-orchestration-core diff --git a/sharding-orchestration/sharding-orchestration-reg/pom.xml b/sharding-orchestration/sharding-orchestration-reg/pom.xml index fbc107a0983bb..1a2c4e20ebabd 100644 --- a/sharding-orchestration/sharding-orchestration-reg/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/pom.xml @@ -2,12 +2,12 @@ + 4.0.0 - sharding-orchestration io.shardingsphere + sharding-orchestration 3.0.0.M5-SNAPSHOT - 4.0.0 sharding-orchestration-reg pom diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/pom.xml index ae4de19bf03cf..1a881e1241703 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-api/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - sharding-orchestration-reg io.shardingsphere + sharding-orchestration-reg 3.0.0.M5-SNAPSHOT sharding-orchestration-reg-api diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml index b0d4c691d0fe5..9380128ffa970 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-etcd/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - sharding-orchestration-reg io.shardingsphere + sharding-orchestration-reg 3.0.0.M5-SNAPSHOT sharding-orchestration-reg-etcd diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml index 933956bca0991..8d4de8deca0b1 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-native-zookeeper/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - sharding-orchestration-reg io.shardingsphere + sharding-orchestration-reg 3.0.0.M5-SNAPSHOT sharding-orchestration-reg-native-zookeeper diff --git a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml index e200cd8ee2468..c1b0d55d6c893 100644 --- a/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml +++ b/sharding-orchestration/sharding-orchestration-reg/sharding-orchestration-reg-zookeeper-curator/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - sharding-orchestration-reg io.shardingsphere + sharding-orchestration-reg 3.0.0.M5-SNAPSHOT sharding-orchestration-reg-zookeeper-curator diff --git a/sharding-proxy/pom.xml b/sharding-proxy/pom.xml index b10e89d04e55d..27339aa94c715 100644 --- a/sharding-proxy/pom.xml +++ b/sharding-proxy/pom.xml @@ -9,7 +9,6 @@ 3.0.0.M5-SNAPSHOT sharding-proxy - ${project.artifactId} diff --git a/sharding-sql-test/pom.xml b/sharding-sql-test/pom.xml index b6bbfd57b05eb..817be9a49f764 100644 --- a/sharding-sql-test/pom.xml +++ b/sharding-sql-test/pom.xml @@ -4,10 +4,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - sharding-sphere io.shardingsphere + sharding-sphere 3.0.0.M5-SNAPSHOT sharding-sql-test - ${project.artifactId} diff --git a/sharding-transaction/pom.xml b/sharding-transaction/pom.xml index bfc47ce71dd07..3d276cfe82782 100644 --- a/sharding-transaction/pom.xml +++ b/sharding-transaction/pom.xml @@ -9,7 +9,6 @@ 3.0.0.M5-SNAPSHOT sharding-transaction - ${project.artifactId}