You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2020/09/22 11:19:35 UTC
[shardingsphere] branch master updated: Rename
shardingsphere-primary-replica-replication module (#7565)
This is an automated email from the ASF dual-hosted git repository.
panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 9a7e4e3 Rename shardingsphere-primary-replica-replication module (#7565)
9a7e4e3 is described below
commit 9a7e4e305e10ddbd805a88420c8e31a40c33f8f1
Author: Liang Zhang <te...@163.com>
AuthorDate: Tue Sep 22 19:19:18 2020 +0800
Rename shardingsphere-primary-replica-replication module (#7565)
---
shardingsphere-features/pom.xml | 2 +-
.../shardingsphere-master-slave/pom.xml | 38 --------
.../api/config/MasterSlaveRuleConfiguration.java | 39 --------
.../MasterSlaveDataSourceRuleConfiguration.java | 39 --------
.../shardingsphere-master-slave-common/pom.xml | 47 ----------
.../RoundRobinMasterSlaveLoadBalanceAlgorithm.java | 52 -----------
.../config/YamlMasterSlaveRuleConfiguration.java | 45 ----------
.../MasterSlaveRuleConfigurationYamlSwapper.java | 95 --------------------
...masterslave.spi.MasterSlaveLoadBalanceAlgorithm | 19 ----
...ndRobinMasterSlaveLoadBalanceAlgorithmTest.java | 42 ---------
.../masterslave/rule/MasterSlaveRuleTest.java | 100 ---------------------
.../rule/biulder/MasterSlaveRuleBuilderTest.java | 50 -----------
...onsForYamlMasterSlaveRuleConfigurationTest.java | 82 -----------------
.../src/test/resources/logback-test.xml | 33 -------
.../shardingsphere-master-slave-route/pom.xml | 43 ---------
.../route/engine/MasterSlaveRouteDecorator.java | 77 ----------------
.../route/engine/impl/MasterVisitedManager.java | 55 ------------
.../condition/MasterSlaveSpringBootCondition.java | 38 --------
.../src/main/resources/META-INF/spring.factories | 19 ----
.../boot/MasterSlaveSpringBootStarterTest.java | 65 --------------
.../MasterSlaveSpringBootConditionTest.java | 60 -------------
.../resources/application-masterslave.properties | 22 -----
...MasterSlaveLoadBalanceAlgorithmFactoryBean.java | 38 --------
.../handler/MasterSlaveNamespaceHandler.java | 37 --------
.../src/main/resources/META-INF/spring.handlers | 18 ----
.../namespace/MasterSlaveSpringNamespaceTest.java | 85 ------------------
.../pom.xml | 4 +-
.../spi/MasterSlaveLoadBalanceAlgorithm.java | 0
.../RandomMasterSlaveLoadBalanceAlgorithm.java | 0
...orithmProvidedMasterSlaveRuleConfiguration.java | 0
.../masterslave/constant/MasterSlaveOrder.java | 0
.../rule/MasterSlaveDataSourceRule.java | 0
.../masterslave/rule/MasterSlaveRule.java | 0
.../AlgorithmProvidedMasterSlaveRuleBuilder.java | 0
.../rule/biulder/MasterSlaveRuleBuilder.java | 0
...YamlMasterSlaveDataSourceRuleConfiguration.java | 0
...eAlgorithmProviderConfigurationYamlSwapper.java | 0
...dingsphere.infra.rule.ShardingSphereRuleBuilder | 0
...infra.yaml.swapper.YamlRuleConfigurationSwapper | 0
.../RandomMasterSlaveLoadBalanceAlgorithmTest.java | 0
.../rule/MasterSlaveDataSourceRuleTest.java | 0
...lgorithmProvidedMasterSlaveRuleBuilderTest.java | 0
...orithmProviderConfigurationYamlSwapperTest.java | 0
...asterSlaveRuleConfigurationYamlSwapperTest.java | 0
.../src/test/resources/logback-test.xml | 0
.../src/test/resources/yaml/master-slave-rule.yaml | 0
.../engine/impl/MasterSlaveDataSourceRouter.java | 0
...dingsphere.infra.route.decorator.RouteDecorator | 0
.../engine/MasterSlaveRouteDecoratorTest.java | 0
.../pom.xml | 8 +-
.../pom.xml | 6 +-
.../MasterSlaveRuleSpringbootConfiguration.java | 0
.../MasterSlaveAlgorithmProvidedBeanRegistry.java | 0
...YamlMasterSlaveRuleSpringBootConfiguration.java | 0
.../src/main/resources/META-INF/spring.provides | 2 +-
.../pom.xml | 6 +-
.../MasterSlaveRuleBeanDefinitionParser.java | 0
.../tag/LoadBalanceAlgorithmBeanDefinitionTag.java | 0
.../tag/MasterSlaveRuleBeanDefinitionTag.java | 0
.../resources/META-INF/namespace/master-slave.xsd | 0
.../src/main/resources/META-INF/spring.schemas | 0
.../spring/master-slave-application-context.xml | 0
.../src/test/resources/logback-test.xml | 0
.../shardingsphere-governance-core-common/pom.xml | 2 +-
.../shardingsphere-jdbc-core/pom.xml | 2 +-
.../pom.xml | 2 +-
.../pom.xml | 2 +-
.../pom.xml | 2 +-
.../shardingsphere-proxy-backend/pom.xml | 2 +-
.../shardingsphere-proxy-common/pom.xml | 2 +-
70 files changed, 21 insertions(+), 1259 deletions(-)
diff --git a/shardingsphere-features/pom.xml b/shardingsphere-features/pom.xml
index 8e136be..ff60577 100644
--- a/shardingsphere-features/pom.xml
+++ b/shardingsphere-features/pom.xml
@@ -31,7 +31,7 @@
<modules>
<module>shardingsphere-sharding</module>
- <module>shardingsphere-master-slave</module>
+ <module>shardingsphere-primary-replica-replication</module>
<module>shardingsphere-encrypt</module>
<module>shardingsphere-shadow</module>
<module>shardingsphere-consensus-replication</module>
diff --git a/shardingsphere-features/shardingsphere-master-slave/pom.xml b/shardingsphere-features/shardingsphere-master-slave/pom.xml
deleted file mode 100644
index 74a8a7c..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You 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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-features</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>shardingsphere-master-slave</artifactId>
- <name>${project.artifactId}</name>
- <packaging>pom</packaging>
-
- <modules>
- <module>shardingsphere-master-slave-api</module>
- <module>shardingsphere-master-slave-common</module>
- <module>shardingsphere-master-slave-route</module>
- <module>shardingsphere-master-slave-spring</module>
- </modules>
-</project>
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/api/config/MasterSlaveRuleConfiguration.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/api/config/MasterSlaveRuleConfiguration.java
deleted file mode 100644
index 13aaf14..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/api/config/MasterSlaveRuleConfiguration.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.api.config;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.config.RuleConfiguration;
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * Master-slave rule configuration.
- */
-@RequiredArgsConstructor
-@Getter
-public final class MasterSlaveRuleConfiguration implements RuleConfiguration {
-
- private final Collection<MasterSlaveDataSourceRuleConfiguration> dataSources;
-
- private final Map<String, ShardingSphereAlgorithmConfiguration> loadBalancers;
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/api/config/rule/MasterSlaveDataSourceRuleConfiguration.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/api/config/rule/MasterSlaveDataSourceRuleConfiguration.java
deleted file mode 100644
index 32008fd..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/api/config/rule/MasterSlaveDataSourceRuleConfiguration.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.api.config.rule;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-
-import java.util.List;
-
-/**
- * Master-slave data source rule configuration.
- */
-@RequiredArgsConstructor
-@Getter
-public final class MasterSlaveDataSourceRuleConfiguration {
-
- private final String name;
-
- private final String masterDataSourceName;
-
- private final List<String> slaveDataSourceNames;
-
- private final String loadBalancerName;
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/pom.xml b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/pom.xml
deleted file mode 100644
index 3e521d6..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You 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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>shardingsphere-master-slave-common</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- </dependency>
- <dependency>
- <groupId>com.zaxxer</groupId>
- <artifactId>HikariCP</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/RoundRobinMasterSlaveLoadBalanceAlgorithm.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/RoundRobinMasterSlaveLoadBalanceAlgorithm.java
deleted file mode 100644
index 6106213..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/RoundRobinMasterSlaveLoadBalanceAlgorithm.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.algorithm;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.shardingsphere.masterslave.spi.MasterSlaveLoadBalanceAlgorithm;
-
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Round-robin slave database load-balance algorithm.
- */
-@Getter
-@Setter
-public final class RoundRobinMasterSlaveLoadBalanceAlgorithm implements MasterSlaveLoadBalanceAlgorithm {
-
- private static final ConcurrentHashMap<String, AtomicInteger> COUNTS = new ConcurrentHashMap<>();
-
- private Properties props = new Properties();
-
- @Override
- public String getDataSource(final String name, final String masterDataSourceName, final List<String> slaveDataSourceNames) {
- AtomicInteger count = COUNTS.containsKey(name) ? COUNTS.get(name) : new AtomicInteger(0);
- COUNTS.putIfAbsent(name, count);
- count.compareAndSet(slaveDataSourceNames.size(), 0);
- return slaveDataSourceNames.get(Math.abs(count.getAndIncrement()) % slaveDataSourceNames.size());
- }
-
- @Override
- public String getType() {
- return "ROUND_ROBIN";
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/config/YamlMasterSlaveRuleConfiguration.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/config/YamlMasterSlaveRuleConfiguration.java
deleted file mode 100644
index 40e0cf8..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/config/YamlMasterSlaveRuleConfiguration.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.yaml.config;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.apache.shardingsphere.infra.yaml.config.YamlRuleConfiguration;
-import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.yaml.config.rule.YamlMasterSlaveDataSourceRuleConfiguration;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * Master-slave rule configuration for YAML.
- */
-@Getter
-@Setter
-public final class YamlMasterSlaveRuleConfiguration implements YamlRuleConfiguration {
-
- private Map<String, YamlMasterSlaveDataSourceRuleConfiguration> dataSources = new LinkedHashMap<>();
-
- private Map<String, YamlShardingSphereAlgorithmConfiguration> loadBalancers = new LinkedHashMap<>();
-
- @Override
- public Class<MasterSlaveRuleConfiguration> getRuleConfigurationType() {
- return MasterSlaveRuleConfiguration.class;
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleConfigurationYamlSwapper.java
deleted file mode 100644
index c070ee8..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleConfigurationYamlSwapper.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.yaml.swapper;
-
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
-import org.apache.shardingsphere.infra.yaml.swapper.algorithm.ShardingSphereAlgorithmConfigurationYamlSwapper;
-import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
-import org.apache.shardingsphere.masterslave.constant.MasterSlaveOrder;
-import org.apache.shardingsphere.masterslave.yaml.config.YamlMasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.yaml.config.rule.YamlMasterSlaveDataSourceRuleConfiguration;
-
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.stream.Collectors;
-
-/**
- * Master-slave rule configuration YAML swapper.
- */
-public final class MasterSlaveRuleConfigurationYamlSwapper implements YamlRuleConfigurationSwapper<YamlMasterSlaveRuleConfiguration, MasterSlaveRuleConfiguration> {
-
- private final ShardingSphereAlgorithmConfigurationYamlSwapper algorithmSwapper = new ShardingSphereAlgorithmConfigurationYamlSwapper();
-
- @Override
- public YamlMasterSlaveRuleConfiguration swapToYamlConfiguration(final MasterSlaveRuleConfiguration data) {
- YamlMasterSlaveRuleConfiguration result = new YamlMasterSlaveRuleConfiguration();
- result.setDataSources(data.getDataSources().stream().collect(
- Collectors.toMap(MasterSlaveDataSourceRuleConfiguration::getName, this::swapToYamlConfiguration, (a, b) -> b, LinkedHashMap::new)));
- if (null != data.getLoadBalancers()) {
- data.getLoadBalancers().forEach((key, value) -> result.getLoadBalancers().put(key, algorithmSwapper.swapToYamlConfiguration(value)));
- }
- return result;
- }
-
- private YamlMasterSlaveDataSourceRuleConfiguration swapToYamlConfiguration(final MasterSlaveDataSourceRuleConfiguration dataSourceRuleConfiguration) {
- YamlMasterSlaveDataSourceRuleConfiguration result = new YamlMasterSlaveDataSourceRuleConfiguration();
- result.setName(dataSourceRuleConfiguration.getName());
- result.setMasterDataSourceName(dataSourceRuleConfiguration.getMasterDataSourceName());
- result.setSlaveDataSourceNames(dataSourceRuleConfiguration.getSlaveDataSourceNames());
- result.setLoadBalancerName(dataSourceRuleConfiguration.getLoadBalancerName());
- return result;
- }
-
- @Override
- public MasterSlaveRuleConfiguration swapToObject(final YamlMasterSlaveRuleConfiguration yamlConfig) {
- Collection<MasterSlaveDataSourceRuleConfiguration> dataSources = new LinkedList<>();
- for (Entry<String, YamlMasterSlaveDataSourceRuleConfiguration> entry : yamlConfig.getDataSources().entrySet()) {
- dataSources.add(swapToObject(entry.getKey(), entry.getValue()));
- }
- Map<String, ShardingSphereAlgorithmConfiguration> loadBalancers = new LinkedHashMap<>(yamlConfig.getLoadBalancers().entrySet().size(), 1);
- if (null != yamlConfig.getLoadBalancers()) {
- yamlConfig.getLoadBalancers().forEach((key, value) -> loadBalancers.put(key, algorithmSwapper.swapToObject(value)));
- }
- return new MasterSlaveRuleConfiguration(dataSources, loadBalancers);
- }
-
- private MasterSlaveDataSourceRuleConfiguration swapToObject(final String name, final YamlMasterSlaveDataSourceRuleConfiguration yamlDataSourceRuleConfiguration) {
- return new MasterSlaveDataSourceRuleConfiguration(name,
- yamlDataSourceRuleConfiguration.getMasterDataSourceName(), yamlDataSourceRuleConfiguration.getSlaveDataSourceNames(), yamlDataSourceRuleConfiguration.getLoadBalancerName());
- }
-
- @Override
- public Class<MasterSlaveRuleConfiguration> getTypeClass() {
- return MasterSlaveRuleConfiguration.class;
- }
-
- @Override
- public String getRuleTagName() {
- return "MASTER_SLAVE";
- }
-
- @Override
- public int getOrder() {
- return MasterSlaveOrder.ORDER;
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/resources/META-INF/services/org.apache.shardingsphere.masterslave.spi.MasterSlaveLoadBalanceAlgorithm b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/resources/META-INF/services/org.apache.shardingsphere.masterslave.spi.MasterSlaveLoadBalanceAlgorithm
deleted file mode 100644
index aaa245d..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/resources/META-INF/services/org.apache.shardingsphere.masterslave.spi.MasterSlaveLoadBalanceAlgorithm
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-
-org.apache.shardingsphere.masterslave.algorithm.RoundRobinMasterSlaveLoadBalanceAlgorithm
-org.apache.shardingsphere.masterslave.algorithm.RandomMasterSlaveLoadBalanceAlgorithm
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/algorithm/RoundRobinMasterSlaveLoadBalanceAlgorithmTest.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/algorithm/RoundRobinMasterSlaveLoadBalanceAlgorithmTest.java
deleted file mode 100644
index 2d6b61e..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/algorithm/RoundRobinMasterSlaveLoadBalanceAlgorithmTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.algorithm;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public final class RoundRobinMasterSlaveLoadBalanceAlgorithmTest {
-
- private final RoundRobinMasterSlaveLoadBalanceAlgorithm roundRobinMasterSlaveLoadBalanceAlgorithm = new RoundRobinMasterSlaveLoadBalanceAlgorithm();
-
- @Test
- public void assertGetDataSource() {
- String masterDataSourceName = "test_ds_master";
- String slaveDataSourceName1 = "test_ds_slave_1";
- String slaveDataSourceName2 = "test_ds_slave_2";
- List<String> slaveDataSourceNames = Arrays.asList(slaveDataSourceName1, slaveDataSourceName2);
- assertThat(roundRobinMasterSlaveLoadBalanceAlgorithm.getDataSource("ds", masterDataSourceName, slaveDataSourceNames), is(slaveDataSourceName1));
- assertThat(roundRobinMasterSlaveLoadBalanceAlgorithm.getDataSource("ds", masterDataSourceName, slaveDataSourceNames), is(slaveDataSourceName2));
- assertThat(roundRobinMasterSlaveLoadBalanceAlgorithm.getDataSource("ds", masterDataSourceName, slaveDataSourceNames), is(slaveDataSourceName1));
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveRuleTest.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveRuleTest.java
deleted file mode 100644
index 8bab229..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveRuleTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.rule;
-
-import com.google.common.collect.ImmutableMap;
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.rule.event.impl.DataSourceNameDisabledEvent;
-import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Properties;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public final class MasterSlaveRuleTest {
-
- @Test(expected = IllegalArgumentException.class)
- public void assertNewWithEmptyDataSourceRule() {
- new MasterSlaveRule(new MasterSlaveRuleConfiguration(Collections.emptyList(), Collections.emptyMap()));
- }
-
- @Test
- public void assertFindDataSourceRule() {
- Optional<MasterSlaveDataSourceRule> actual = createMasterSlaveRule().findDataSourceRule("test_ms");
- assertTrue(actual.isPresent());
- assertDataSourceRule(actual.get());
- }
-
- @Test
- public void assertGetSingleDataSourceRule() {
- assertDataSourceRule(createMasterSlaveRule().getSingleDataSourceRule());
- }
-
- private MasterSlaveRule createMasterSlaveRule() {
- MasterSlaveDataSourceRuleConfiguration configuration = new MasterSlaveDataSourceRuleConfiguration("test_ms", "master_db", Arrays.asList("slave_db_0", "slave_db_1"), "random");
- return new MasterSlaveRule(new MasterSlaveRuleConfiguration(
- Collections.singleton(configuration), ImmutableMap.of("random", new ShardingSphereAlgorithmConfiguration("RANDOM", new Properties()))));
- }
-
- private void assertDataSourceRule(final MasterSlaveDataSourceRule actual) {
- assertThat(actual.getName(), is("test_ms"));
- assertThat(actual.getMasterDataSourceName(), is("master_db"));
- assertThat(actual.getSlaveDataSourceNames(), is(Arrays.asList("slave_db_0", "slave_db_1")));
- assertThat(actual.getLoadBalancer().getType(), is("RANDOM"));
- }
-
- @Test
- public void assertUpdateRuleStatusWithNotExistDataSource() {
- MasterSlaveRule masterSlaveRule = createMasterSlaveRule();
- masterSlaveRule.updateRuleStatus(new DataSourceNameDisabledEvent("slave_db", true));
- assertThat(masterSlaveRule.getSingleDataSourceRule().getSlaveDataSourceNames(), is(Arrays.asList("slave_db_0", "slave_db_1")));
- }
-
- @Test
- public void assertUpdateRuleStatus() {
- MasterSlaveRule masterSlaveRule = createMasterSlaveRule();
- masterSlaveRule.updateRuleStatus(new DataSourceNameDisabledEvent("slave_db_0", true));
- assertThat(masterSlaveRule.getSingleDataSourceRule().getSlaveDataSourceNames(), is(Collections.singletonList("slave_db_1")));
- }
-
- @Test
- public void assertUpdateRuleStatusWithEnable() {
- MasterSlaveRule masterSlaveRule = createMasterSlaveRule();
- masterSlaveRule.updateRuleStatus(new DataSourceNameDisabledEvent("slave_db_0", true));
- assertThat(masterSlaveRule.getSingleDataSourceRule().getSlaveDataSourceNames(), is(Collections.singletonList("slave_db_1")));
- masterSlaveRule.updateRuleStatus(new DataSourceNameDisabledEvent("slave_db_0", false));
- assertThat(masterSlaveRule.getSingleDataSourceRule().getSlaveDataSourceNames(), is(Arrays.asList("slave_db_0", "slave_db_1")));
- }
-
- @Test
- public void assertGetDataSourceMapper() {
- MasterSlaveRule masterSlaveRule = createMasterSlaveRule();
- Map<String, Collection<String>> actual = masterSlaveRule.getDataSourceMapper();
- Map<String, Collection<String>> expected = ImmutableMap.of("test_ms", Arrays.asList("master_db", "slave_db_0", "slave_db_1"));
- assertThat(actual, is(expected));
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/biulder/MasterSlaveRuleBuilderTest.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/biulder/MasterSlaveRuleBuilderTest.java
deleted file mode 100644
index e19a174..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/biulder/MasterSlaveRuleBuilderTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.rule.biulder;
-
-import org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder;
-import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
-import org.apache.shardingsphere.infra.spi.order.OrderedSPIRegistry;
-import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
-import org.apache.shardingsphere.masterslave.rule.MasterSlaveRule;
-import org.junit.Test;
-
-import java.util.Collections;
-
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-public final class MasterSlaveRuleBuilderTest {
-
- static {
- ShardingSphereServiceLoader.register(ShardingSphereRuleBuilder.class);
- }
-
- @Test
- public void assertBuild() {
- MasterSlaveRuleConfiguration ruleConfig = mock(MasterSlaveRuleConfiguration.class);
- MasterSlaveDataSourceRuleConfiguration ruleConfiguration = new MasterSlaveDataSourceRuleConfiguration("name", "masterDataSourceName",
- Collections.singletonList("name"), "loadBalancerName");
- when(ruleConfig.getDataSources()).thenReturn(Collections.singletonList(ruleConfiguration));
- ShardingSphereRuleBuilder builder = OrderedSPIRegistry.getRegisteredServices(Collections.singletonList(ruleConfig), ShardingSphereRuleBuilder.class).get(ruleConfig);
- assertThat(builder.build(ruleConfig, Collections.emptyList()), instanceOf(MasterSlaveRule.class));
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/YamlRootRuleConfigurationsForYamlMasterSlaveRuleConfigurationTest.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/YamlRootRuleConfigurationsForYamlMasterSlaveRuleConfigurationTest.java
deleted file mode 100644
index 37b0b5c..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/YamlRootRuleConfigurationsForYamlMasterSlaveRuleConfigurationTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.yaml.swapper;
-
-import org.apache.shardingsphere.infra.yaml.config.YamlRootRuleConfigurations;
-import org.apache.shardingsphere.infra.yaml.engine.YamlEngine;
-import org.apache.shardingsphere.masterslave.yaml.config.YamlMasterSlaveRuleConfiguration;
-import org.junit.Test;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Arrays;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-
-public final class YamlRootRuleConfigurationsForYamlMasterSlaveRuleConfigurationTest {
-
- @Test
- public void assertUnmarshalWithYamlFile() throws IOException {
- URL url = getClass().getClassLoader().getResource("yaml/master-slave-rule.yaml");
- assertNotNull(url);
- YamlRootRuleConfigurations rootRuleConfigurations = YamlEngine.unmarshal(new File(url.getFile()), YamlRootRuleConfigurations.class);
- assertThat(rootRuleConfigurations.getRules().size(), is(1));
- assertMasterSlaveRule((YamlMasterSlaveRuleConfiguration) rootRuleConfigurations.getRules().iterator().next());
- }
-
- @Test
- public void assertUnmarshalWithYamlBytes() throws IOException {
- URL url = getClass().getClassLoader().getResource("yaml/master-slave-rule.yaml");
- assertNotNull(url);
- StringBuilder yamlContent = new StringBuilder();
- try (
- FileReader fileReader = new FileReader(url.getFile());
- BufferedReader reader = new BufferedReader(fileReader)) {
- String line;
- while (null != (line = reader.readLine())) {
- yamlContent.append(line).append(System.lineSeparator());
- }
- }
- YamlRootRuleConfigurations rootRuleConfigs = YamlEngine.unmarshal(yamlContent.toString().getBytes(), YamlRootRuleConfigurations.class);
- assertThat(rootRuleConfigs.getRules().size(), is(1));
- assertMasterSlaveRule((YamlMasterSlaveRuleConfiguration) rootRuleConfigs.getRules().iterator().next());
- }
-
- private void assertMasterSlaveRule(final YamlMasterSlaveRuleConfiguration actual) {
- assertThat(actual.getDataSources().size(), is(2));
- assertMasterSlaveRuleForDs0(actual);
- assertMasterSlaveRuleForDs1(actual);
- }
-
- private void assertMasterSlaveRuleForDs0(final YamlMasterSlaveRuleConfiguration actual) {
- assertThat(actual.getDataSources().get("ds_0").getMasterDataSourceName(), is("master_ds_0"));
- assertThat(actual.getDataSources().get("ds_0").getSlaveDataSourceNames(), is(Arrays.asList("master_ds_0_slave_0", "master_ds_0_slave_1")));
- assertThat(actual.getDataSources().get("ds_0").getLoadBalancerName(), is("roundRobin"));
- }
-
- private void assertMasterSlaveRuleForDs1(final YamlMasterSlaveRuleConfiguration actual) {
- assertThat(actual.getDataSources().get("ds_1").getMasterDataSourceName(), is("master_ds_1"));
- assertThat(actual.getDataSources().get("ds_1").getSlaveDataSourceNames(), is(Arrays.asList("master_ds_1_slave_0", "master_ds_1_slave_1")));
- assertThat(actual.getDataSources().get("ds_1").getLoadBalancerName(), is("random"));
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/resources/logback-test.xml b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/resources/logback-test.xml
deleted file mode 100644
index 5ca5dfa..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You 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.
- -->
-
-<configuration>
- <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
- <encoder>
- <pattern>[%-5level] %d{HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
- <logger name="org.apache.shardingsphere" level="warn" additivity="false">
- <appender-ref ref="console" />
- </logger>
-
- <root>
- <level value="error" />
- <appender-ref ref="console" />
- </root>
-</configuration>
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/pom.xml b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/pom.xml
deleted file mode 100644
index 3e18c9c..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You 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.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave</artifactId>
- <version>5.0.0-RC1-SNAPSHOT</version>
- </parent>
- <artifactId>shardingsphere-master-slave-route</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-infra-route</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-common</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-</project>
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/MasterSlaveRouteDecorator.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/MasterSlaveRouteDecorator.java
deleted file mode 100644
index 24f67ba..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/MasterSlaveRouteDecorator.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.route.engine;
-
-import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
-import org.apache.shardingsphere.infra.database.DefaultSchema;
-import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
-import org.apache.shardingsphere.infra.route.context.DefaultRouteStageContext;
-import org.apache.shardingsphere.infra.route.context.RouteContext;
-import org.apache.shardingsphere.infra.route.context.RouteMapper;
-import org.apache.shardingsphere.infra.route.context.RouteResult;
-import org.apache.shardingsphere.infra.route.context.RouteUnit;
-import org.apache.shardingsphere.infra.route.decorator.RouteDecorator;
-import org.apache.shardingsphere.masterslave.constant.MasterSlaveOrder;
-import org.apache.shardingsphere.masterslave.route.engine.impl.MasterSlaveDataSourceRouter;
-import org.apache.shardingsphere.masterslave.rule.MasterSlaveDataSourceRule;
-import org.apache.shardingsphere.masterslave.rule.MasterSlaveRule;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.Optional;
-
-/**
- * Route decorator for master-slave.
- */
-public final class MasterSlaveRouteDecorator implements RouteDecorator<MasterSlaveRule> {
-
- @Override
- public RouteContext decorate(final RouteContext routeContext, final ShardingSphereMetaData metaData, final MasterSlaveRule masterSlaveRule, final ConfigurationProperties props) {
- if (routeContext.getRouteResult().getRouteUnits().isEmpty()) {
- String dataSourceName = new MasterSlaveDataSourceRouter(masterSlaveRule.getSingleDataSourceRule()).route(routeContext.getSqlStatementContext().getSqlStatement());
- RouteResult routeResult = new RouteResult();
- routeResult.getRouteUnits().add(new RouteUnit(new RouteMapper(DefaultSchema.LOGIC_NAME, dataSourceName), Collections.emptyList()));
- return new RouteContext(routeContext, routeResult, new DefaultRouteStageContext(), getTypeClass());
- }
- Collection<RouteUnit> toBeRemoved = new LinkedList<>();
- Collection<RouteUnit> toBeAdded = new LinkedList<>();
- for (RouteUnit each : routeContext.getRouteResult().getRouteUnits()) {
- String dataSourceName = each.getDataSourceMapper().getLogicName();
- Optional<MasterSlaveDataSourceRule> dataSourceRule = masterSlaveRule.findDataSourceRule(dataSourceName);
- if (dataSourceRule.isPresent() && dataSourceRule.get().getName().equalsIgnoreCase(each.getDataSourceMapper().getActualName())) {
- toBeRemoved.add(each);
- String actualDataSourceName = new MasterSlaveDataSourceRouter(dataSourceRule.get()).route(routeContext.getSqlStatementContext().getSqlStatement());
- toBeAdded.add(new RouteUnit(new RouteMapper(each.getDataSourceMapper().getLogicName(), actualDataSourceName), each.getTableMappers()));
- }
- }
- routeContext.getRouteResult().getRouteUnits().removeAll(toBeRemoved);
- routeContext.getRouteResult().getRouteUnits().addAll(toBeAdded);
- return routeContext;
- }
-
- @Override
- public int getOrder() {
- return MasterSlaveOrder.ORDER;
- }
-
- @Override
- public Class<MasterSlaveRule> getTypeClass() {
- return MasterSlaveRule.class;
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/impl/MasterVisitedManager.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/impl/MasterVisitedManager.java
deleted file mode 100644
index 5b1b0df..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/impl/MasterVisitedManager.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.route.engine.impl;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-/**
- * Master data source visited manager.
- *
- * <p>Trace master data source visited or not in current thread.</p>
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class MasterVisitedManager {
-
- private static final ThreadLocal<Boolean> MASTER_VISITED = ThreadLocal.withInitial(() -> false);
-
- /**
- * Judge master data source visited in current thread.
- *
- * @return master data source visited or not in current thread
- */
- public static boolean isMasterVisited() {
- return MASTER_VISITED.get();
- }
-
- /**
- * Set master data source visited in current thread.
- */
- public static void setMasterVisited() {
- MASTER_VISITED.set(true);
- }
-
- /**
- * Clear master data source visited.
- */
- public static void clear() {
- MASTER_VISITED.remove();
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/condition/MasterSlaveSpringBootCondition.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/condition/MasterSlaveSpringBootCon [...]
deleted file mode 100644
index 5a31e26..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/condition/MasterSlaveSpringBootCondition.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.spring.boot.condition;
-
-import org.apache.shardingsphere.spring.boot.util.PropertyUtil;
-import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
-import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
-import org.springframework.context.annotation.ConditionContext;
-import org.springframework.core.type.AnnotatedTypeMetadata;
-
-/**
- * Spring boot condition for master-slave .
- */
-public final class MasterSlaveSpringBootCondition extends SpringBootCondition {
-
- private static final String MASTER_SLAVE_PREFIX = "spring.shardingsphere.rules.master-slave";
-
- @Override
- public ConditionOutcome getMatchOutcome(final ConditionContext conditionContext, final AnnotatedTypeMetadata annotatedTypeMetadata) {
- return PropertyUtil.containPropertyPrefix(conditionContext.getEnvironment(), MASTER_SLAVE_PREFIX)
- ? ConditionOutcome.match() : ConditionOutcome.noMatch("Can't find ShardingSphere master-slave rule configuration in local file.");
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/resources/META-INF/spring.factories b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index 769ba76..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-org.apache.shardingsphere.masterslave.spring.boot.MasterSlaveRuleSpringbootConfiguration
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveSpringBootStarterTest.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveSpringBootStarterTest.java
deleted file mode 100644
index f1058aa..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveSpringBootStarterTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.spring.boot;
-
-import org.apache.shardingsphere.masterslave.algorithm.RandomMasterSlaveLoadBalanceAlgorithm;
-import org.apache.shardingsphere.masterslave.algorithm.config.AlgorithmProvidedMasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-import javax.annotation.Resource;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest(classes = MasterSlaveSpringBootStarterTest.class)
-@SpringBootApplication
-@ActiveProfiles("masterslave")
-public class MasterSlaveSpringBootStarterTest {
-
- @Resource
- private RandomMasterSlaveLoadBalanceAlgorithm random;
-
- @Resource
- private AlgorithmProvidedMasterSlaveRuleConfiguration masterSlaveRuleConfiguration;
-
- @Test
- public void assertLoadBalanceAlgorithm() {
- assertTrue(random.getProps().isEmpty());
- }
-
- @Test
- public void assertMasterSlaveRuleConfiguration() {
- assertThat(masterSlaveRuleConfiguration.getDataSources().size(), is(1));
- MasterSlaveDataSourceRuleConfiguration masterSlaveDataSourceRuleConfiguration = masterSlaveRuleConfiguration.getDataSources().stream().findFirst().get();
- assertThat(masterSlaveDataSourceRuleConfiguration.getName(), is("ds_ms"));
- assertThat(masterSlaveDataSourceRuleConfiguration.getMasterDataSourceName(), is("ds_master"));
- assertThat(masterSlaveDataSourceRuleConfiguration.getLoadBalancerName(), is("random"));
- assertThat(masterSlaveDataSourceRuleConfiguration.getSlaveDataSourceNames().size(), is(2));
- assertTrue(masterSlaveRuleConfiguration.getDataSources().contains(masterSlaveDataSourceRuleConfiguration));
- assertThat(masterSlaveRuleConfiguration.getLoadBalanceAlgorithms().size(), is(1));
- assertTrue(masterSlaveRuleConfiguration.getLoadBalanceAlgorithms().containsKey("random"));
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/java/org/apache/shardingsphere/masterslave/spring/boot/condition/MasterSlaveSpringBootConditionTest.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/java/org/apache/shardingsphere/masterslave/spring/boot/condition/MasterSlaveSpringBoo [...]
deleted file mode 100644
index 3a7d43a..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/java/org/apache/shardingsphere/masterslave/spring/boot/condition/MasterSlaveSpringBootConditionTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.spring.boot.condition;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
-import org.springframework.context.annotation.ConditionContext;
-import org.springframework.core.type.AnnotatedTypeMetadata;
-import org.springframework.mock.env.MockEnvironment;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-@RunWith(MockitoJUnitRunner.class)
-public final class MasterSlaveSpringBootConditionTest {
-
- @Test
- public void assertNotMatch() {
- MockEnvironment mockEnvironment = new MockEnvironment();
- mockEnvironment.setProperty("spring.shardingsphere.rules.encrypt.encryptors.aes_encryptor.type", "AES");
- mockEnvironment.setProperty("spring.shardingsphere.rules.shadow.column", "user_id");
- ConditionContext context = mock(ConditionContext.class);
- AnnotatedTypeMetadata metadata = mock(AnnotatedTypeMetadata.class);
- when(context.getEnvironment()).thenReturn(mockEnvironment);
- MasterSlaveSpringBootCondition condition = new MasterSlaveSpringBootCondition();
- ConditionOutcome matchOutcome = condition.getMatchOutcome(context, metadata);
- assertFalse(matchOutcome.isMatch());
- }
-
- @Test
- public void assertMatch() {
- MockEnvironment mockEnvironment = new MockEnvironment();
- mockEnvironment.setProperty("spring.shardingsphere.rules.master-slave.data-sources.ds_ms.master-data-source-name", "ds_master");
- ConditionContext context = mock(ConditionContext.class);
- AnnotatedTypeMetadata metadata = mock(AnnotatedTypeMetadata.class);
- when(context.getEnvironment()).thenReturn(mockEnvironment);
- MasterSlaveSpringBootCondition condition = new MasterSlaveSpringBootCondition();
- ConditionOutcome matchOutcome = condition.getMatchOutcome(context, metadata);
- assertTrue(matchOutcome.isMatch());
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/resources/application-masterslave.properties b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/resources/application-masterslave.properties
deleted file mode 100644
index 067dd1f..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/resources/application-masterslave.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-
-spring.shardingsphere.rules.master-slave.load-balancers.random.type=RANDOM
-
-spring.shardingsphere.rules.master-slave.data-sources.ds_ms.master-data-source-name=ds_master
-spring.shardingsphere.rules.master-slave.data-sources.ds_ms.slave-data-source-names=ds_slave_0,ds_slave_1
-spring.shardingsphere.rules.master-slave.data-sources.ds_ms.load-balancer-name=random
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/factorybean/MasterSlaveLoadBalanceAlgorithmFactoryBean.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/factorybean/Mast [...]
deleted file mode 100644
index 5c550cb..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/factorybean/MasterSlaveLoadBalanceAlgorithmFactoryBean.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.spring.namespace.factorybean;
-
-import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
-import org.apache.shardingsphere.masterslave.spi.MasterSlaveLoadBalanceAlgorithm;
-import org.apache.shardingsphere.spring.namespace.factorybean.ShardingSphereAlgorithmFactoryBean;
-
-import java.util.Properties;
-
-/**
- * Master-slave load balance algorithm factory bean.
- */
-public final class MasterSlaveLoadBalanceAlgorithmFactoryBean extends ShardingSphereAlgorithmFactoryBean<MasterSlaveLoadBalanceAlgorithm> {
-
- static {
- ShardingSphereServiceLoader.register(MasterSlaveLoadBalanceAlgorithm.class);
- }
-
- public MasterSlaveLoadBalanceAlgorithmFactoryBean(final String type, final Properties props) {
- super(MasterSlaveLoadBalanceAlgorithm.class, type, props);
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/handler/MasterSlaveNamespaceHandler.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/handler/MasterSlaveNamespaceHandler.java
deleted file mode 100644
index 2eaf491..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/handler/MasterSlaveNamespaceHandler.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.spring.namespace.handler;
-
-import org.apache.shardingsphere.masterslave.spring.namespace.factorybean.MasterSlaveLoadBalanceAlgorithmFactoryBean;
-import org.apache.shardingsphere.masterslave.spring.namespace.parser.MasterSlaveRuleBeanDefinitionParser;
-import org.apache.shardingsphere.masterslave.spring.namespace.tag.LoadBalanceAlgorithmBeanDefinitionTag;
-import org.apache.shardingsphere.masterslave.spring.namespace.tag.MasterSlaveRuleBeanDefinitionTag;
-import org.apache.shardingsphere.spring.namespace.parser.ShardingSphereAlgorithmBeanDefinitionParser;
-import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
-
-/**
- * Spring namespace handler for master-slave.
- */
-public final class MasterSlaveNamespaceHandler extends NamespaceHandlerSupport {
-
- @Override
- public void init() {
- registerBeanDefinitionParser(MasterSlaveRuleBeanDefinitionTag.ROOT_TAG, new MasterSlaveRuleBeanDefinitionParser());
- registerBeanDefinitionParser(LoadBalanceAlgorithmBeanDefinitionTag.ROOT_TAG, new ShardingSphereAlgorithmBeanDefinitionParser(MasterSlaveLoadBalanceAlgorithmFactoryBean.class));
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/resources/META-INF/spring.handlers b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/resources/META-INF/spring.handlers
deleted file mode 100644
index 2b51f38..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/resources/META-INF/spring.handlers
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-
-http\://shardingsphere.apache.org/schema/shardingsphere/masterslave=org.apache.shardingsphere.masterslave.spring.namespace.handler.MasterSlaveNamespaceHandler
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/test/java/org/apache/shardingsphere/masterslave/spring/namespace/MasterSlaveSpringNamespaceTest.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/test/java/org/apache/shardingsphere/masterslave/spring/namespace/MasterSlaveSpringNamespaceTest.java
deleted file mode 100644
index f449ec4..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/test/java/org/apache/shardingsphere/masterslave/spring/namespace/MasterSlaveSpringNamespaceTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 org.apache.shardingsphere.masterslave.spring.namespace;
-
-import org.apache.shardingsphere.masterslave.algorithm.RandomMasterSlaveLoadBalanceAlgorithm;
-import org.apache.shardingsphere.masterslave.algorithm.config.AlgorithmProvidedMasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
-import org.apache.shardingsphere.masterslave.spi.MasterSlaveLoadBalanceAlgorithm;
-import org.junit.Test;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
-
-import javax.annotation.Resource;
-import java.util.Arrays;
-import java.util.Map;
-
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-@ContextConfiguration(locations = "classpath:META-INF/spring/master-slave-application-context.xml")
-public final class MasterSlaveSpringNamespaceTest extends AbstractJUnit4SpringContextTests {
-
- @Resource
- private MasterSlaveLoadBalanceAlgorithm randomLoadbalancer;
-
- @Resource
- private AlgorithmProvidedMasterSlaveRuleConfiguration defaultMasterSlaveRule;
-
- @Resource
- private AlgorithmProvidedMasterSlaveRuleConfiguration randomMasterSlaveRule;
-
- @Test
- public void assertRandomLoadbalancer() {
- assertThat(randomLoadbalancer.getType(), is("RANDOM"));
- }
-
- @Test
- public void assertDefaultMaserSlaveDataSource() {
- assertLoadBalancers(defaultMasterSlaveRule.getLoadBalanceAlgorithms());
- assertThat(defaultMasterSlaveRule.getDataSources().size(), is(1));
- assertDefaultMasterSlaveDataSourceRule(defaultMasterSlaveRule.getDataSources().iterator().next());
- }
-
- private void assertLoadBalancers(final Map<String, MasterSlaveLoadBalanceAlgorithm> loadBalances) {
- assertThat(loadBalances.size(), is(1));
- assertThat(loadBalances.get("randomLoadbalancer"), instanceOf(RandomMasterSlaveLoadBalanceAlgorithm.class));
- }
-
- private void assertDefaultMasterSlaveDataSourceRule(final MasterSlaveDataSourceRuleConfiguration dataSourceRuleConfig) {
- assertThat(dataSourceRuleConfig.getName(), is("default_ds"));
- assertThat(dataSourceRuleConfig.getMasterDataSourceName(), is("master_ds"));
- assertThat(dataSourceRuleConfig.getSlaveDataSourceNames(), is(Arrays.asList("slave_ds_0", "slave_ds_1")));
- assertThat(dataSourceRuleConfig.getLoadBalancerName(), is(""));
- }
-
- @Test
- public void assertRandomMaserSlaveDataSource() {
- assertLoadBalancers(randomMasterSlaveRule.getLoadBalanceAlgorithms());
- assertThat(randomMasterSlaveRule.getDataSources().size(), is(1));
- assertRandomMasterSlaveDataSourceRule(randomMasterSlaveRule.getDataSources().iterator().next());
- }
-
- private void assertRandomMasterSlaveDataSourceRule(final MasterSlaveDataSourceRuleConfiguration dataSourceRuleConfig) {
- assertThat(dataSourceRuleConfig.getName(), is("random_ds"));
- assertThat(dataSourceRuleConfig.getMasterDataSourceName(), is("master_ds"));
- assertThat(dataSourceRuleConfig.getSlaveDataSourceNames(), is(Arrays.asList("slave_ds_0", "slave_ds_1")));
- assertThat(dataSourceRuleConfig.getLoadBalancerName(), is("randomLoadbalancer"));
- }
-}
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/pom.xml b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-api/pom.xml
similarity index 91%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/pom.xml
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-api/pom.xml
index f9c19e5..10e5918 100644
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/pom.xml
+++ b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-api/pom.xml
@@ -22,10 +22,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
- <artifactId>shardingsphere-master-slave-api</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-api</artifactId>
<name>${project.artifactId}</name>
<dependencies>
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/spi/MasterSlaveLoadBalanceAlgorithm.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-api/src/main/java/org/apache/shardingsphere/masterslave/spi/MasterSlaveLoadBalanceAlgorithm.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/spi/MasterSlaveLoadBalanceAlgorithm.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-api/src/main/java/org/apache/shardingsphere/masterslave/spi/MasterSlaveLoadBalanceAlgorithm.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/RandomMasterSlaveLoadBalanceAlgorithm.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/RandomMasterSlaveLoadBalanceAlgorithm.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/RandomMasterSlaveLoadBalanceAlgorithm.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/RandomMasterSlaveLoadBalanceAlgorithm.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/config/AlgorithmProvidedMasterSlaveRuleConfiguration.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/config/AlgorithmProvidedMasterSlaveRuleConfiguration.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/config/AlgorithmProvidedMasterSlaveRuleConfiguration.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/algorithm/config/AlgorithmProvidedMasterSlaveRuleConfiguration.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/constant/MasterSlaveOrder.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/constant/MasterSlaveOrder.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/constant/MasterSlaveOrder.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/constant/MasterSlaveOrder.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveDataSourceRule.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveDataSourceRule.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveDataSourceRule.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveDataSourceRule.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveRule.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveRule.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveRule.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveRule.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/rule/biulder/AlgorithmProvidedMasterSlaveRuleBuilder.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/rule/biulder/AlgorithmProvidedMasterSlaveRuleBuilder.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/rule/biulder/AlgorithmProvidedMasterSlaveRuleBuilder.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/rule/biulder/AlgorithmProvidedMasterSlaveRuleBuilder.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/rule/biulder/MasterSlaveRuleBuilder.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/rule/biulder/MasterSlaveRuleBuilder.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/rule/biulder/MasterSlaveRuleBuilder.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/rule/biulder/MasterSlaveRuleBuilder.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/config/rule/YamlMasterSlaveDataSourceRuleConfiguration.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/config/rule/YamlMasterSlaveDataSourceRuleConfiguration.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/config/rule/YamlMasterSlaveDataSourceRuleConfiguration.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/config/rule/YamlMasterSlaveDataSourceRuleConfiguration.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleAlgorithmProviderConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleAlgorithmProviderConfigurationYamlSwapper.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleAlgorithmProviderConfigurationYamlSwapper.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleAlgorithmProviderConfigurationYamlSwapper.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.rule.ShardingSphereRuleBuilder
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/algorithm/RandomMasterSlaveLoadBalanceAlgorithmTest.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/algorithm/RandomMasterSlaveLoadBalanceAlgorithmTest.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/algorithm/RandomMasterSlaveLoadBalanceAlgorithmTest.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/algorithm/RandomMasterSlaveLoadBalanceAlgorithmTest.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveDataSourceRuleTest.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveDataSourceRuleTest.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveDataSourceRuleTest.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/rule/MasterSlaveDataSourceRuleTest.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/biulder/AlgorithmProvidedMasterSlaveRuleBuilderTest.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/rule/biulder/AlgorithmProvidedMasterSlaveRuleBuilderTest.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/rule/biulder/AlgorithmProvidedMasterSlaveRuleBuilderTest.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/rule/biulder/AlgorithmProvidedMasterSlaveRuleBuilderTest.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleAlgorithmProviderConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleAlgorithmProviderConfigurationYamlSwapperTest.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleAlgorithmProviderConfigurationYamlSwapperTest.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleAlgorithmProviderConfigurationYamlSwapperTest.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleConfigurationYamlSwapperTest.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleConfigurationYamlSwapperTest.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleConfigurationYamlSwapperTest.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/resources/logback-test.xml b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/resources/logback-test.xml
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/test/resources/logback-test.xml
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/resources/logback-test.xml
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/resources/yaml/master-slave-rule.yaml b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/resources/yaml/master-slave-rule.yaml
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-common/src/test/resources/yaml/master-slave-rule.yaml
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/resources/yaml/master-slave-rule.yaml
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/impl/MasterSlaveDataSourceRouter.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/impl/MasterSlaveDataSourceRouter.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/impl/MasterSlaveDataSourceRouter.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-route/src/main/java/org/apache/shardingsphere/masterslave/route/engine/impl/MasterSlaveDataSourceRouter.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.route.decorator.RouteDecorator b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-route/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.route.decorator.RouteDecorator
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.route.decorator.RouteDecorator
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-route/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.route.decorator.RouteDecorator
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/test/java/org/apache/shardingsphere/masterslave/route/engine/MasterSlaveRouteDecoratorTest.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-route/src/test/java/org/apache/shardingsphere/masterslave/route/engine/MasterSlaveRouteDecoratorTest.java
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-route/src/test/java/org/apache/shardingsphere/masterslave/route/engine/MasterSlaveRouteDecoratorTest.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-route/src/test/java/org/apache/shardingsphere/masterslave/route/engine/MasterSlaveRouteDecoratorTest.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/pom.xml b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/pom.xml
similarity index 80%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/pom.xml
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/pom.xml
index 9e3701b..febd4c2 100644
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/pom.xml
+++ b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/pom.xml
@@ -22,15 +22,15 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
- <artifactId>shardingsphere-master-slave-spring</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-spring</artifactId>
<name>${project.artifactId}</name>
<packaging>pom</packaging>
<modules>
- <module>shardingsphere-master-slave-spring-namespace</module>
- <module>shardingsphere-master-slave-spring-boot-starter</module>
+ <module>shardingsphere-primary-replica-replication-spring-namespace</module>
+ <module>shardingsphere-primary-replica-replication-spring-boot-starter</module>
</modules>
</project>
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/pom.xml b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/pom.xml
similarity index 90%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/pom.xml
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/pom.xml
index fd2c57f..5bdda6d 100644
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/pom.xml
+++ b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/pom.xml
@@ -22,16 +22,16 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-spring</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-spring</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
- <artifactId>shardingsphere-master-slave-spring-boot-starter</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-spring-boot-starter</artifactId>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-common</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveRuleSpringbootConfiguration.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spr [...]
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveRuleSpringbootConfiguration.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/MasterSlaveRuleSpringbootConfiguration.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/algorithm/MasterSlaveAlgorithmProvidedBeanRegistry.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/src/main/java/org/apache/shardingsphere/mas [...]
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/algorithm/MasterSlaveAlgorithmProvidedBeanRegistry.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/algorithm/MasterSlaveAlgorithmProvidedBeanRegistry.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/rule/YamlMasterSlaveRuleSpringBootConfiguration.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/src/main/java/org/apache/shardingsphere/master [...]
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/rule/YamlMasterSlaveRuleSpringBootConfiguration.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/src/main/java/org/apache/shardingsphere/masterslave/spring/boot/rule/YamlMasterSlaveRuleSpringBootConfiguration.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/resources/META-INF/spring.provides b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/src/main/resources/META-INF/spring.provides
similarity index 91%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/resources/META-INF/spring.provides
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/src/main/resources/META-INF/spring.provides
index 3e6b55f..f3fc6a9 100644
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-boot-starter/src/main/resources/META-INF/spring.provides
+++ b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-boot-starter/src/main/resources/META-INF/spring.provides
@@ -15,4 +15,4 @@
# limitations under the License.
#
-provides: shardingsphere-master-slave-spring-boot-starter
+provides: shardingsphere-primary-replica-replication-spring-boot-starter
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/pom.xml b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/pom.xml
similarity index 88%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/pom.xml
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/pom.xml
index e2fb788..1303f49 100644
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/pom.xml
+++ b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/pom.xml
@@ -22,16 +22,16 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-spring</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-spring</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</parent>
- <artifactId>shardingsphere-master-slave-spring-namespace</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-spring-namespace</artifactId>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-common</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/parser/MasterSlaveRuleBeanDefinitionParser.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/ [...]
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/parser/MasterSlaveRuleBeanDefinitionParser.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/parser/MasterSlaveRuleBeanDefinitionParser.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/LoadBalanceAlgorithmBeanDefinitionTag.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/s [...]
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/LoadBalanceAlgorithmBeanDefinitionTag.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/LoadBalanceAlgorithmBeanDefinitionTag.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/MasterSlaveRuleBeanDefinitionTag.java b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring [...]
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/MasterSlaveRuleBeanDefinitionTag.java
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/MasterSlaveRuleBeanDefinitionTag.java
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/resources/META-INF/namespace/master-slave.xsd b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/resources/META-INF/namespace/master-slave.xsd
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/resources/META-INF/namespace/master-slave.xsd
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/resources/META-INF/namespace/master-slave.xsd
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/resources/META-INF/spring.schemas b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/resources/META-INF/spring.schemas
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/resources/META-INF/spring.schemas
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/main/resources/META-INF/spring.schemas
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/test/resources/META-INF/spring/master-slave-application-context.xml b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/test/resources/META-INF/spring/master-slave-application-context.xml
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/test/resources/META-INF/spring/master-slave-application-context.xml
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/test/resources/META-INF/spring/master-slave-application-context.xml
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/test/resources/logback-test.xml b/shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/test/resources/logback-test.xml
similarity index 100%
rename from shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/test/resources/logback-test.xml
rename to shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-spring/shardingsphere-primary-replica-replication-spring-namespace/src/test/resources/logback-test.xml
diff --git a/shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-common/pom.xml b/shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-common/pom.xml
index b894242..f691a91 100644
--- a/shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-common/pom.xml
+++ b/shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-common/pom.xml
@@ -39,7 +39,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-common</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/pom.xml b/shardingsphere-jdbc/shardingsphere-jdbc-core/pom.xml
index c736f30..9d02d8a 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/pom.xml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/pom.xml
@@ -69,7 +69,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-route</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-route</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/pom.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/pom.xml
index 2f26129..906c589 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/pom.xml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/pom.xml
@@ -44,7 +44,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-spring-boot-starter</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-spring-boot-starter</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/pom.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/pom.xml
index 43292b5..86ef15c 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/pom.xml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/pom.xml
@@ -40,7 +40,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-spring-namespace</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-spring-namespace</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-governance-spring/shardingsphere-jdbc-governance-spring-boot-starter/pom.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-governance-spring/shardingsphere-jdbc-governance-spring-boot-starter/pom.xml
index c0184b4..a54a7d4 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-governance-spring/shardingsphere-jdbc-governance-spring-boot-starter/pom.xml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-governance-spring/shardingsphere-jdbc-governance-spring-boot-starter/pom.xml
@@ -44,7 +44,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-spring-boot-starter</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-spring-boot-starter</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/pom.xml b/shardingsphere-proxy/shardingsphere-proxy-backend/pom.xml
index caa5b9e..4f8c70e 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/pom.xml
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/pom.xml
@@ -79,7 +79,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-route</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-route</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
diff --git a/shardingsphere-proxy/shardingsphere-proxy-common/pom.xml b/shardingsphere-proxy/shardingsphere-proxy-common/pom.xml
index 68575c7..3e28017 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-common/pom.xml
+++ b/shardingsphere-proxy/shardingsphere-proxy-common/pom.xml
@@ -49,7 +49,7 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-master-slave-common</artifactId>
+ <artifactId>shardingsphere-primary-replica-replication-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>