You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/06/27 06:41:16 UTC
[shardingsphere] branch master updated: Remove useless props in DatabaseRuleBuilder (#18626)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 77eed85d874 Remove useless props in DatabaseRuleBuilder (#18626)
77eed85d874 is described below
commit 77eed85d874edbdeedeed9f07c52066e44b81a96
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Mon Jun 27 14:41:10 2022 +0800
Remove useless props in DatabaseRuleBuilder (#18626)
---
.../builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilder.java | 3 +--
.../dbdiscovery/rule/builder/DatabaseDiscoveryRuleBuilder.java | 3 +--
.../AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest.java | 7 ++-----
.../rule/builder/DatabaseDiscoveryRuleBuilderTest.java | 4 +---
.../rule/builder/AlgorithmProvidedEncryptRuleBuilder.java | 3 +--
.../shardingsphere/encrypt/rule/builder/EncryptRuleBuilder.java | 3 +--
.../rule/builder/AlgorithmProvidedEncryptRuleBuilderTest.java | 4 +---
.../encrypt/rule/builder/EncryptRuleBuilderTest.java | 4 +---
.../builder/AlgorithmProvidedReadwriteSplittingRuleBuilder.java | 3 +--
.../rule/builder/ReadwriteSplittingRuleBuilder.java | 3 +--
.../AlgorithmProvidedReadwriteSplittingRuleBuilderTest.java | 3 +--
.../rule/builder/ReadwriteSplittingRuleBuilderTest.java | 3 +--
.../shadow/rule/builder/AlgorithmProvidedShadowRuleBuilder.java | 3 +--
.../shardingsphere/shadow/rule/builder/ShadowRuleBuilder.java | 3 +--
.../shadow/rule/builder/ShadowRuleBuilderTest.java | 4 +---
.../rule/builder/AlgorithmProvidedShardingRuleBuilder.java | 3 +--
.../sharding/rule/builder/ShardingRuleBuilder.java | 3 +--
.../rule/builder/AlgorithmProvidedShardingRuleBuilderTest.java | 9 +++------
.../sharding/rule/builder/ShardingRuleBuilderTest.java | 9 +++------
.../infra/metadata/database/ShardingSphereDatabase.java | 2 +-
.../infra/rule/builder/schema/DatabaseRuleBuilder.java | 4 +---
.../infra/rule/builder/schema/DatabaseRulesBuilder.java | 6 ++----
.../infra/fixture/TestShardingSphereRuleBuilder.java | 3 +--
.../infra/rule/builder/fixture/FixtureDatabaseRuleBuilder.java | 3 +--
.../infra/rule/builder/schema/DatabaseRulesBuilderTest.java | 6 ++----
.../singletable/rule/builder/SingleTableRuleBuilder.java | 3 +--
.../singletable/rule/builder/SingleTableRuleBuilderTest.java | 8 ++------
.../org/apache/shardingsphere/mode/manager/ContextManager.java | 4 ++--
.../shardingsphere/mode/metadata/fixture/FixtureRuleBuilder.java | 3 +--
.../engine/AbstractSQLRewriterParameterizedTest.java | 3 +--
30 files changed, 39 insertions(+), 83 deletions(-)
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilder.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilder.java
index 3f06e166930..a956d8ac74e 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilder.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.dbdiscovery.rule.builder;
import org.apache.shardingsphere.dbdiscovery.algorithm.config.AlgorithmProvidedDatabaseDiscoveryRuleConfiguration;
import org.apache.shardingsphere.dbdiscovery.constant.DatabaseDiscoveryOrder;
import org.apache.shardingsphere.dbdiscovery.rule.DatabaseDiscoveryRule;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
@@ -35,7 +34,7 @@ public final class AlgorithmProvidedDatabaseDiscoveryRuleBuilder implements Data
@Override
public DatabaseDiscoveryRule build(final AlgorithmProvidedDatabaseDiscoveryRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return new DatabaseDiscoveryRule(databaseName, dataSources, config);
}
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/builder/DatabaseDiscoveryRuleBuilder.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/builder/DatabaseDiscoveryRuleBuilder.java
index 7914842bac8..31a72148cbc 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/builder/DatabaseDiscoveryRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/rule/builder/DatabaseDiscoveryRuleBuilder.java
@@ -21,7 +21,6 @@ import org.apache.shardingsphere.dbdiscovery.api.config.DatabaseDiscoveryRuleCon
import org.apache.shardingsphere.dbdiscovery.api.config.rule.DatabaseDiscoveryDataSourceRuleConfiguration;
import org.apache.shardingsphere.dbdiscovery.constant.DatabaseDiscoveryOrder;
import org.apache.shardingsphere.dbdiscovery.rule.DatabaseDiscoveryRule;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
@@ -37,7 +36,7 @@ public final class DatabaseDiscoveryRuleBuilder implements DatabaseRuleBuilder<D
@Override
public DatabaseDiscoveryRule build(final DatabaseDiscoveryRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
Map<String, DataSource> realDataSourceMap = new HashMap<>();
for (DatabaseDiscoveryDataSourceRuleConfiguration each : config.getDataSources()) {
for (String datasourceName : each.getDataSourceNames()) {
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest.java
index 2b7e007a26c..3f64ce56501 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest.java
@@ -22,7 +22,6 @@ import org.apache.shardingsphere.dbdiscovery.api.config.rule.DatabaseDiscoveryDa
import org.apache.shardingsphere.dbdiscovery.api.config.rule.DatabaseDiscoveryHeartBeatConfiguration;
import org.apache.shardingsphere.dbdiscovery.fixture.CoreDatabaseDiscoveryProviderAlgorithmFixture;
import org.apache.shardingsphere.dbdiscovery.rule.DatabaseDiscoveryRule;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
import org.apache.shardingsphere.test.mock.MockedDataSource;
@@ -41,11 +40,9 @@ public final class AlgorithmProvidedDatabaseDiscoveryRuleBuilderTest {
public void assertBuild() {
AlgorithmProvidedDatabaseDiscoveryRuleConfiguration algorithmProvidedRuleConfig = new AlgorithmProvidedDatabaseDiscoveryRuleConfiguration(
Collections.singletonList(new DatabaseDiscoveryDataSourceRuleConfiguration("name", Collections.singletonList("name"), "", "discoveryTypeName")),
- Collections.singletonMap("ha_heartbeat",
- new DatabaseDiscoveryHeartBeatConfiguration(new Properties())),
+ Collections.singletonMap("ha_heartbeat", new DatabaseDiscoveryHeartBeatConfiguration(new Properties())),
Collections.singletonMap("discoveryTypeName", new CoreDatabaseDiscoveryProviderAlgorithmFixture()));
DatabaseRuleBuilder builder = DatabaseRuleBuilderFactory.getInstanceMap(Collections.singletonList(algorithmProvidedRuleConfig)).get(algorithmProvidedRuleConfig);
- assertThat(builder.build(algorithmProvidedRuleConfig, "", Collections.singletonMap("name", new MockedDataSource()), Collections.emptyList(), new ConfigurationProperties(new Properties())),
- instanceOf(DatabaseDiscoveryRule.class));
+ assertThat(builder.build(algorithmProvidedRuleConfig, "", Collections.singletonMap("name", new MockedDataSource()), Collections.emptyList()), instanceOf(DatabaseDiscoveryRule.class));
}
}
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/DatabaseDiscoveryRuleBuilderTest.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/DatabaseDiscoveryRuleBuilderTest.java
index 407b023acbb..d530a9fb827 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/DatabaseDiscoveryRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/test/java/org/apache/shardingsphere/dbdiscovery/rule/builder/DatabaseDiscoveryRuleBuilderTest.java
@@ -22,7 +22,6 @@ import org.apache.shardingsphere.dbdiscovery.api.config.rule.DatabaseDiscoveryDa
import org.apache.shardingsphere.dbdiscovery.api.config.rule.DatabaseDiscoveryHeartBeatConfiguration;
import org.apache.shardingsphere.dbdiscovery.rule.DatabaseDiscoveryRule;
import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
import org.apache.shardingsphere.test.mock.MockedDataSource;
@@ -44,7 +43,6 @@ public final class DatabaseDiscoveryRuleBuilderTest {
Collections.singletonMap("ha_heartbeat", new DatabaseDiscoveryHeartBeatConfiguration(new Properties())),
Collections.singletonMap("CORE.FIXTURE", new ShardingSphereAlgorithmConfiguration("CORE.FIXTURE", new Properties())));
DatabaseRuleBuilder builder = DatabaseRuleBuilderFactory.getInstanceMap(Collections.singletonList(config)).get(config);
- assertThat(builder.build(config, "test_schema", Collections.singletonMap("name", new MockedDataSource()), Collections.emptyList(), new ConfigurationProperties(new Properties())),
- instanceOf(DatabaseDiscoveryRule.class));
+ assertThat(builder.build(config, "test_schema", Collections.singletonMap("name", new MockedDataSource()), Collections.emptyList()), instanceOf(DatabaseDiscoveryRule.class));
}
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/builder/AlgorithmProvidedEncryptRuleBuilder.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/builder/AlgorithmProvidedEncryptRuleBuilder.java
index f12cb7e6279..08133ddfff9 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/builder/AlgorithmProvidedEncryptRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/builder/AlgorithmProvidedEncryptRuleBuilder.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.encrypt.rule.builder;
import org.apache.shardingsphere.encrypt.algorithm.config.AlgorithmProvidedEncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.constant.EncryptOrder;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
@@ -35,7 +34,7 @@ public final class AlgorithmProvidedEncryptRuleBuilder implements DatabaseRuleBu
@Override
public EncryptRule build(final AlgorithmProvidedEncryptRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return new EncryptRule(config);
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/builder/EncryptRuleBuilder.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/builder/EncryptRuleBuilder.java
index 496063b7920..ae76d6812c8 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/builder/EncryptRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/builder/EncryptRuleBuilder.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.encrypt.rule.builder;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.constant.EncryptOrder;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
@@ -35,7 +34,7 @@ public final class EncryptRuleBuilder implements DatabaseRuleBuilder<EncryptRule
@Override
public EncryptRule build(final EncryptRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return new EncryptRule(config);
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/builder/AlgorithmProvidedEncryptRuleBuilderTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/builder/AlgorithmProvidedEncryptRuleBuilderTest.java
index 7b039be3b25..c35cff48729 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/builder/AlgorithmProvidedEncryptRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/builder/AlgorithmProvidedEncryptRuleBuilderTest.java
@@ -19,13 +19,11 @@ package org.apache.shardingsphere.encrypt.rule.builder;
import org.apache.shardingsphere.encrypt.algorithm.config.AlgorithmProvidedEncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
import org.junit.Test;
import java.util.Collections;
-import java.util.Properties;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
@@ -37,6 +35,6 @@ public final class AlgorithmProvidedEncryptRuleBuilderTest {
public void assertBuild() {
AlgorithmProvidedEncryptRuleConfiguration ruleConfig = new AlgorithmProvidedEncryptRuleConfiguration();
DatabaseRuleBuilder builder = DatabaseRuleBuilderFactory.getInstanceMap(Collections.singletonList(ruleConfig)).get(ruleConfig);
- assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(EncryptRule.class));
+ assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList()), instanceOf(EncryptRule.class));
}
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/builder/EncryptRuleBuilderTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/builder/EncryptRuleBuilderTest.java
index c61d828ffd4..b71327775ce 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/builder/EncryptRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/test/java/org/apache/shardingsphere/encrypt/rule/builder/EncryptRuleBuilderTest.java
@@ -19,13 +19,11 @@ package org.apache.shardingsphere.encrypt.rule.builder;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.rule.EncryptRule;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
import org.junit.Test;
import java.util.Collections;
-import java.util.Properties;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
@@ -38,6 +36,6 @@ public final class EncryptRuleBuilderTest {
public void assertBuild() {
EncryptRuleConfiguration ruleConfig = mock(EncryptRuleConfiguration.class);
DatabaseRuleBuilder builder = DatabaseRuleBuilderFactory.getInstanceMap(Collections.singletonList(ruleConfig)).get(ruleConfig);
- assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(EncryptRule.class));
+ assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList()), instanceOf(EncryptRule.class));
}
}
diff --git a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/builder/AlgorithmProvidedReadwriteSplittingRuleBuilder.java b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/builder/AlgorithmProvidedReadwriteSplittingRuleBuilder.java
index eef434ccaeb..2a4730d3983 100644
--- a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/builder/AlgorithmProvidedReadwriteSplittingRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/builder/AlgorithmProvidedReadwriteSplittingRuleBuilder.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.readwritesplitting.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.readwritesplitting.algorithm.config.AlgorithmProvidedReadwriteSplittingRuleConfiguration;
@@ -35,7 +34,7 @@ public final class AlgorithmProvidedReadwriteSplittingRuleBuilder implements Dat
@Override
public ReadwriteSplittingRule build(final AlgorithmProvidedReadwriteSplittingRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return new ReadwriteSplittingRule(config);
}
diff --git a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/builder/ReadwriteSplittingRuleBuilder.java b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/builder/ReadwriteSplittingRuleBuilder.java
index d24c5f66e86..c8efbfd36a4 100644
--- a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/builder/ReadwriteSplittingRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/builder/ReadwriteSplittingRuleBuilder.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.readwritesplitting.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
@@ -35,7 +34,7 @@ public final class ReadwriteSplittingRuleBuilder implements DatabaseRuleBuilder<
@Override
public ReadwriteSplittingRule build(final ReadwriteSplittingRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return new ReadwriteSplittingRule(config);
}
diff --git a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/builder/AlgorithmProvidedReadwriteSplittingRuleBuilderTest.java b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/builder/AlgorithmProvidedReadwriteSplittingRuleBuilderTest.java
index ac05c363d94..270e5be6f48 100644
--- a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/builder/AlgorithmProvidedReadwriteSplittingRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/builder/AlgorithmProvidedReadwriteSplittingRuleBuilderTest.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.readwritesplitting.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
import org.apache.shardingsphere.readwritesplitting.algorithm.config.AlgorithmProvidedReadwriteSplittingRuleConfiguration;
@@ -39,7 +38,7 @@ public final class AlgorithmProvidedReadwriteSplittingRuleBuilderTest {
AlgorithmProvidedReadwriteSplittingRuleConfiguration ruleConfig = new AlgorithmProvidedReadwriteSplittingRuleConfiguration(
Collections.singletonList(new ReadwriteSplittingDataSourceRuleConfiguration("name", "Static", createProperties(), "loadBalancerName")), Collections.emptyMap());
DatabaseRuleBuilder builder = DatabaseRuleBuilderFactory.getInstanceMap(Collections.singletonList(ruleConfig)).get(ruleConfig);
- assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ReadwriteSplittingRule.class));
+ assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList()), instanceOf(ReadwriteSplittingRule.class));
}
private Properties createProperties() {
diff --git a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/builder/ReadwriteSplittingRuleBuilderTest.java b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/builder/ReadwriteSplittingRuleBuilderTest.java
index 5930aed7562..c34b605ad0b 100644
--- a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/builder/ReadwriteSplittingRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/test/java/org/apache/shardingsphere/readwritesplitting/rule/builder/ReadwriteSplittingRuleBuilderTest.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.readwritesplitting.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
import org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
@@ -39,7 +38,7 @@ public final class ReadwriteSplittingRuleBuilderTest {
ReadwriteSplittingRuleConfiguration ruleConfig = new ReadwriteSplittingRuleConfiguration(
Collections.singletonList(new ReadwriteSplittingDataSourceRuleConfiguration("name", "Static", createProperties(), "loadBalancerName")), Collections.emptyMap());
DatabaseRuleBuilder builder = DatabaseRuleBuilderFactory.getInstanceMap(Collections.singletonList(ruleConfig)).get(ruleConfig);
- assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ReadwriteSplittingRule.class));
+ assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList()), instanceOf(ReadwriteSplittingRule.class));
}
private Properties createProperties() {
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/builder/AlgorithmProvidedShadowRuleBuilder.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/builder/AlgorithmProvidedShadowRuleBuilder.java
index c9d9643d54f..34cedfdb838 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/builder/AlgorithmProvidedShadowRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/builder/AlgorithmProvidedShadowRuleBuilder.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.shadow.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.shadow.algorithm.config.AlgorithmProvidedShadowRuleConfiguration;
@@ -35,7 +34,7 @@ public final class AlgorithmProvidedShadowRuleBuilder implements DatabaseRuleBui
@Override
public ShadowRule build(final AlgorithmProvidedShadowRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return new ShadowRule(config);
}
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/builder/ShadowRuleBuilder.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/builder/ShadowRuleBuilder.java
index ad0de86f221..aa2782939f9 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/builder/ShadowRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/rule/builder/ShadowRuleBuilder.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.shadow.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
@@ -35,7 +34,7 @@ public final class ShadowRuleBuilder implements DatabaseRuleBuilder<ShadowRuleCo
@Override
public ShadowRule build(final ShadowRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return new ShadowRule(config);
}
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/rule/builder/ShadowRuleBuilderTest.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/rule/builder/ShadowRuleBuilderTest.java
index 1f56f043fc1..27f8a2c1aca 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/rule/builder/ShadowRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/rule/builder/ShadowRuleBuilderTest.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.shadow.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
@@ -25,7 +24,6 @@ import org.apache.shardingsphere.shadow.rule.ShadowRule;
import org.junit.Test;
import java.util.Collections;
-import java.util.Properties;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
@@ -37,6 +35,6 @@ public final class ShadowRuleBuilderTest {
public void assertBuild() {
ShadowRuleConfiguration ruleConfig = new ShadowRuleConfiguration();
DatabaseRuleBuilder builder = DatabaseRuleBuilderFactory.getInstanceMap(Collections.singletonList(ruleConfig)).get(ruleConfig);
- assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShadowRule.class));
+ assertThat(builder.build(ruleConfig, "", Collections.emptyMap(), Collections.emptyList()), instanceOf(ShadowRule.class));
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/builder/AlgorithmProvidedShardingRuleBuilder.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/builder/AlgorithmProvidedShardingRuleBuilder.java
index 4b9cd7434e5..b0e04122d60 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/builder/AlgorithmProvidedShardingRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/builder/AlgorithmProvidedShardingRuleBuilder.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.sharding.rule.builder;
import com.google.common.base.Preconditions;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.sharding.algorithm.config.AlgorithmProvidedShardingRuleConfiguration;
@@ -36,7 +35,7 @@ public final class AlgorithmProvidedShardingRuleBuilder implements DatabaseRuleB
@Override
public ShardingRule build(final AlgorithmProvidedShardingRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
Preconditions.checkArgument(null != dataSources && !dataSources.isEmpty(), "Data sources cannot be empty.");
return new ShardingRule(config, dataSources.keySet());
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/builder/ShardingRuleBuilder.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/builder/ShardingRuleBuilder.java
index f471a6dff2a..9078836dbc5 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/builder/ShardingRuleBuilder.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/builder/ShardingRuleBuilder.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.sharding.rule.builder;
import com.google.common.base.Preconditions;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
@@ -36,7 +35,7 @@ public final class ShardingRuleBuilder implements DatabaseRuleBuilder<ShardingRu
@Override
public ShardingRule build(final ShardingRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
Preconditions.checkArgument(null != dataSources && !dataSources.isEmpty(), "Data source names cannot be empty.");
return new ShardingRule(config, dataSources.keySet());
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/builder/AlgorithmProvidedShardingRuleBuilderTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/builder/AlgorithmProvidedShardingRuleBuilderTest.java
index 124e3067f7d..64167d2e289 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/builder/AlgorithmProvidedShardingRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/builder/AlgorithmProvidedShardingRuleBuilderTest.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.sharding.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
import org.apache.shardingsphere.sharding.algorithm.config.AlgorithmProvidedShardingRuleConfiguration;
@@ -27,7 +26,6 @@ import org.junit.Test;
import javax.sql.DataSource;
import java.util.Collections;
-import java.util.Properties;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
@@ -50,19 +48,18 @@ public final class AlgorithmProvidedShardingRuleBuilderTest {
@SuppressWarnings("unchecked")
@Test
public void assertBuild() {
- assertThat(builder.build(ruleConfig, "test_schema",
- Collections.singletonMap("name", mock(DataSource.class, RETURNS_DEEP_STUBS)), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShardingRule.class));
+ assertThat(builder.build(ruleConfig, "test_schema", Collections.singletonMap("name", mock(DataSource.class, RETURNS_DEEP_STUBS)), Collections.emptyList()), instanceOf(ShardingRule.class));
}
@SuppressWarnings("unchecked")
@Test(expected = IllegalArgumentException.class)
public void assertBuildWithNullDataSourceMap() {
- assertThat(builder.build(ruleConfig, "test_schema", null, Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShardingRule.class));
+ assertThat(builder.build(ruleConfig, "test_schema", null, Collections.emptyList()), instanceOf(ShardingRule.class));
}
@SuppressWarnings("unchecked")
@Test(expected = IllegalArgumentException.class)
public void assertBuildWithEmptyDataSourceMap() {
- assertThat(builder.build(ruleConfig, "test_schema", Collections.emptyMap(), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShardingRule.class));
+ assertThat(builder.build(ruleConfig, "test_schema", Collections.emptyMap(), Collections.emptyList()), instanceOf(ShardingRule.class));
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/builder/ShardingRuleBuilderTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/builder/ShardingRuleBuilderTest.java
index 5054a0bdfa9..b28e173a3f8 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/builder/ShardingRuleBuilderTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/rule/builder/ShardingRuleBuilderTest.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.sharding.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
@@ -27,7 +26,6 @@ import org.junit.Test;
import javax.sql.DataSource;
import java.util.Collections;
-import java.util.Properties;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
@@ -50,19 +48,18 @@ public final class ShardingRuleBuilderTest {
@SuppressWarnings("unchecked")
@Test
public void assertBuild() {
- assertThat(builder.build(ruleConfig, "test_schema",
- Collections.singletonMap("name", mock(DataSource.class, RETURNS_DEEP_STUBS)), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShardingRule.class));
+ assertThat(builder.build(ruleConfig, "test_schema", Collections.singletonMap("name", mock(DataSource.class, RETURNS_DEEP_STUBS)), Collections.emptyList()), instanceOf(ShardingRule.class));
}
@SuppressWarnings("unchecked")
@Test(expected = IllegalArgumentException.class)
public void assertBuildWithNullDataSourceMap() {
- assertThat(builder.build(ruleConfig, "test_schema", null, Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShardingRule.class));
+ assertThat(builder.build(ruleConfig, "test_schema", null, Collections.emptyList()), instanceOf(ShardingRule.class));
}
@SuppressWarnings("unchecked")
@Test(expected = IllegalArgumentException.class)
public void assertBuildWithEmptyDataSourceMap() {
- assertThat(builder.build(ruleConfig, "test_schema", Collections.emptyMap(), Collections.emptyList(), new ConfigurationProperties(new Properties())), instanceOf(ShardingRule.class));
+ assertThat(builder.build(ruleConfig, "test_schema", Collections.emptyMap(), Collections.emptyList()), instanceOf(ShardingRule.class));
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/database/ShardingSphereDatabase.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/database/ShardingSphereDatabase.java
index 4688f722d8b..279a95ea9ae 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/database/ShardingSphereDatabase.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/database/ShardingSphereDatabase.java
@@ -70,7 +70,7 @@ public final class ShardingSphereDatabase {
*/
public static ShardingSphereDatabase create(final String name, final DatabaseType protocolType, final DatabaseType storageType,
final DatabaseConfiguration databaseConfig, final ConfigurationProperties props) throws SQLException {
- Collection<ShardingSphereRule> databaseRules = DatabaseRulesBuilder.build(name, databaseConfig, props);
+ Collection<ShardingSphereRule> databaseRules = DatabaseRulesBuilder.build(name, databaseConfig);
Map<String, ShardingSphereSchema> schemas = new ConcurrentHashMap<>();
schemas.putAll(GenericSchemaBuilder.build(new GenericSchemaBuilderMaterials(protocolType, storageType, databaseConfig.getDataSources(), databaseRules, props, name)));
schemas.putAll(SystemSchemaBuilder.build(name, protocolType));
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRuleBuilder.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRuleBuilder.java
index 1bc2d9bc1cd..2d3fe0d1ec8 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRuleBuilder.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRuleBuilder.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.infra.rule.builder.schema;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.RuleBuilder;
import org.apache.shardingsphere.infra.rule.identifier.scope.DatabaseRule;
@@ -43,8 +42,7 @@ public interface DatabaseRuleBuilder<T extends RuleConfiguration> extends RuleBu
* @param databaseName database name
* @param dataSources data sources
* @param builtRules built rules
- * @param props configuration properties
* @return built database rule
*/
- DatabaseRule build(T config, String databaseName, Map<String, DataSource> dataSources, Collection<ShardingSphereRule> builtRules, ConfigurationProperties props);
+ DatabaseRule build(T config, String databaseName, Map<String, DataSource> dataSources, Collection<ShardingSphereRule> builtRules);
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRulesBuilder.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRulesBuilder.java
index 943de7a7405..a96a6d7af51 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRulesBuilder.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRulesBuilder.java
@@ -23,7 +23,6 @@ import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.config.database.DatabaseConfiguration;
import org.apache.shardingsphere.infra.config.function.DistributedRuleConfiguration;
import org.apache.shardingsphere.infra.config.function.EnhancedRuleConfiguration;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import java.util.Arrays;
@@ -46,14 +45,13 @@ public final class DatabaseRulesBuilder {
*
* @param databaseName database name
* @param databaseConfig database configuration
- * @param props configuration properties
* @return built rules
*/
@SuppressWarnings({"unchecked", "rawtypes"})
- public static Collection<ShardingSphereRule> build(final String databaseName, final DatabaseConfiguration databaseConfig, final ConfigurationProperties props) {
+ public static Collection<ShardingSphereRule> build(final String databaseName, final DatabaseConfiguration databaseConfig) {
Collection<ShardingSphereRule> result = new LinkedList<>();
for (Entry<RuleConfiguration, DatabaseRuleBuilder> entry : getRuleBuilderMap(databaseConfig).entrySet()) {
- result.add(entry.getValue().build(entry.getKey(), databaseName, databaseConfig.getDataSources(), result, props));
+ result.add(entry.getValue().build(entry.getKey(), databaseName, databaseConfig.getDataSources(), result));
}
return result;
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/fixture/TestShardingSphereRuleBuilder.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/fixture/TestShardingSphereRuleBuilder.java
index 5d2e283a1cb..e41e6c00d82 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/fixture/TestShardingSphereRuleBuilder.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/fixture/TestShardingSphereRuleBuilder.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.infra.fixture;
import lombok.Getter;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.identifier.scope.DatabaseRule;
@@ -34,7 +33,7 @@ public final class TestShardingSphereRuleBuilder implements DatabaseRuleBuilder<
@Override
public DatabaseRule build(final TestRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return RULE;
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/fixture/FixtureDatabaseRuleBuilder.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/fixture/FixtureDatabaseRuleBuilder.java
index abb12ab3cbb..07e1883cd19 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/fixture/FixtureDatabaseRuleBuilder.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/fixture/FixtureDatabaseRuleBuilder.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.infra.rule.builder.fixture;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
@@ -29,7 +28,7 @@ public final class FixtureDatabaseRuleBuilder implements DatabaseRuleBuilder<Fix
@Override
public FixtureDatabaseRule build(final FixtureDatabaseRuleConfiguration config, final String databaseName, final Map<String, DataSource> dataSources,
- final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Collection<ShardingSphereRule> builtRules) {
return new FixtureDatabaseRule();
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRulesBuilderTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRulesBuilderTest.java
index e55ed9f4167..d90d4105dba 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRulesBuilderTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/rule/builder/schema/DatabaseRulesBuilderTest.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.infra.rule.builder.schema;
import org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.fixture.TestRuleConfiguration;
import org.apache.shardingsphere.infra.fixture.TestShardingSphereRule;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
@@ -27,7 +26,6 @@ import org.junit.Test;
import java.util.Collections;
import java.util.Iterator;
-import java.util.Properties;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertFalse;
@@ -37,8 +35,8 @@ public final class DatabaseRulesBuilderTest {
@Test
public void assertBuild() {
- Iterator<ShardingSphereRule> actual = DatabaseRulesBuilder.build("schema_name",
- new DataSourceProvidedDatabaseConfiguration(Collections.emptyMap(), Collections.singleton(new TestRuleConfiguration())), new ConfigurationProperties(new Properties())).iterator();
+ Iterator<ShardingSphereRule> actual = DatabaseRulesBuilder.build(
+ "schema_name", new DataSourceProvidedDatabaseConfiguration(Collections.emptyMap(), Collections.singleton(new TestRuleConfiguration()))).iterator();
assertThat(actual.next(), instanceOf(TestShardingSphereRule.class));
assertThat(actual.next(), instanceOf(FixtureDatabaseRule.class));
assertFalse(actual.hasNext());
diff --git a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilder.java b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilder.java
index 02e08d879ca..1a59351e627 100644
--- a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilder.java
+++ b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/main/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilder.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.singletable.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.singletable.config.SingleTableRuleConfiguration;
@@ -35,7 +34,7 @@ public final class SingleTableRuleBuilder implements DatabaseRuleBuilder<SingleT
@Override
public SingleTableRule build(final SingleTableRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return new SingleTableRule(config, databaseName, dataSources, builtRules);
}
diff --git a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilderTest.java b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilderTest.java
index aa6718b8ad8..83fb814c5ac 100644
--- a/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilderTest.java
+++ b/shardingsphere-kernel/shardingsphere-single-table/shardingsphere-single-table-core/src/test/java/org/apache/shardingsphere/singletable/rule/builder/SingleTableRuleBuilderTest.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.singletable.rule.builder;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilderFactory;
@@ -27,7 +26,6 @@ import org.apache.shardingsphere.singletable.rule.SingleTableRule;
import org.junit.Test;
import java.util.Collections;
-import java.util.Properties;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
@@ -39,8 +37,7 @@ public final class SingleTableRuleBuilderTest {
@Test
public void assertBuild() {
DatabaseRuleBuilder builder = DatabaseRuleBuilderFactory.getInstances().iterator().next();
- DatabaseRule actual = builder.build(
- mock(SingleTableRuleConfiguration.class), "", Collections.emptyMap(), Collections.singleton(mock(ShardingSphereRule.class)), new ConfigurationProperties(new Properties()));
+ DatabaseRule actual = builder.build(mock(SingleTableRuleConfiguration.class), "", Collections.emptyMap(), Collections.singleton(mock(ShardingSphereRule.class)));
assertThat(actual, instanceOf(SingleTableRule.class));
}
@@ -48,8 +45,7 @@ public final class SingleTableRuleBuilderTest {
@Test
public void assertBuildWithDefaultDataSource() {
DatabaseRuleBuilder builder = DatabaseRuleBuilderFactory.getInstances().iterator().next();
- DatabaseRule actual = builder.build(
- new SingleTableRuleConfiguration("foo_ds"), "", Collections.emptyMap(), Collections.singleton(mock(ShardingSphereRule.class)), new ConfigurationProperties(new Properties()));
+ DatabaseRule actual = builder.build(new SingleTableRuleConfiguration("foo_ds"), "", Collections.emptyMap(), Collections.singleton(mock(ShardingSphereRule.class)));
assertThat(actual, instanceOf(SingleTableRule.class));
}
}
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java b/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
index 0ca6073489c..92c40602e78 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
@@ -213,8 +213,8 @@ public final class ContextManager implements AutoCloseable {
}
private void refreshRules(final String databaseName, final ShardingSphereDatabase database) {
- Collection<ShardingSphereRule> databaseRules = DatabaseRulesBuilder.build(databaseName, new DataSourceProvidedDatabaseConfiguration(database.getResource().getDataSources(),
- database.getRuleMetaData().getConfigurations()), new ConfigurationProperties(metaDataContexts.getMetaData().getProps().getProps()));
+ Collection<ShardingSphereRule> databaseRules = DatabaseRulesBuilder.build(
+ databaseName, new DataSourceProvidedDatabaseConfiguration(database.getResource().getDataSources(), database.getRuleMetaData().getConfigurations()));
database.getRuleMetaData().getRules().clear();
database.getRuleMetaData().getRules().addAll(databaseRules);
}
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRuleBuilder.java b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRuleBuilder.java
index aa1c359dbea..132c8ec3c02 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRuleBuilder.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRuleBuilder.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.mode.metadata.fixture;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import org.apache.shardingsphere.infra.rule.builder.schema.DatabaseRuleBuilder;
@@ -29,7 +28,7 @@ public final class FixtureRuleBuilder implements DatabaseRuleBuilder<FixtureRule
@Override
public FixtureRule build(final FixtureRuleConfiguration config, final String databaseName,
- final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final ConfigurationProperties props) {
+ final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules) {
return new FixtureRule();
}
diff --git a/shardingsphere-test/shardingsphere-rewrite-test/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameterized/engine/AbstractSQLRewriterParameterizedTest.java b/shardingsphere-test/shardingsphere-rewrite-test/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameterized/engine/AbstractSQLRewriterParameterizedTest.java
index 5d7e05442fe..b99fd7620e3 100644
--- a/shardingsphere-test/shardingsphere-rewrite-test/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameterized/engine/AbstractSQLRewriterParameterizedTest.java
+++ b/shardingsphere-test/shardingsphere-rewrite-test/src/test/java/org/apache/shardingsphere/sharding/rewrite/parameterized/engine/AbstractSQLRewriterParameterizedTest.java
@@ -66,7 +66,6 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import java.util.Properties;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
@@ -108,7 +107,7 @@ public abstract class AbstractSQLRewriterParameterizedTest {
when(resource.getDatabaseType()).thenReturn(databaseType);
String schemaName = DatabaseTypeEngine.getDefaultSchemaName(databaseType, DefaultDatabase.LOGIC_NAME);
Map<String, ShardingSphereSchema> schemas = mockSchemas(schemaName);
- Collection<ShardingSphereRule> databaseRules = DatabaseRulesBuilder.build(DefaultDatabase.LOGIC_NAME, databaseConfig, new ConfigurationProperties(new Properties()));
+ Collection<ShardingSphereRule> databaseRules = DatabaseRulesBuilder.build(DefaultDatabase.LOGIC_NAME, databaseConfig);
mockRules(databaseRules, schemaName);
databaseRules.add(sqlParserRule);
ShardingSphereDatabase database = new ShardingSphereDatabase(schemaName, databaseType, resource, new ShardingSphereRuleMetaData(databaseRules), schemas);