You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/06/14 14:12:05 UTC
[shardingsphere] branch master updated: Add
ShardingSphereAlgorithmConfiguration to abstract algorithm configuration
(#6034)
This is an automated email from the ASF dual-hosted git repository.
zhyee 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 1708dbd Add ShardingSphereAlgorithmConfiguration to abstract algorithm configuration (#6034)
1708dbd is described below
commit 1708dbd407473acafe5fc4c874e6a21b87e71b42
Author: Liang Zhang <te...@163.com>
AuthorDate: Sun Jun 14 22:11:48 2020 +0800
Add ShardingSphereAlgorithmConfiguration to abstract algorithm configuration (#6034)
* remove ShardingAlgorithmConfiguration
* remove KeyGenerateAlgorithmConfiguration
* remove LoadBalanceAlgorithmConfiguration
* remove EncryptAlgorithmConfiguration
* for checkstyle
---
.../config/local/LocalEncryptConfiguration.java | 6 ++--
...calShardingDatabasesAndTablesConfiguration.java | 9 +++---
.../local/LocalShardingDatabasesConfiguration.java | 7 ++---
.../LocalShardingMasterSlaveConfiguration.java | 9 +++---
.../local/LocalShardingTablesConfiguration.java | 7 ++---
.../jdbc/config/EncryptDatabasesConfiguration.java | 8 ++---
.../EncryptShadowDatabasesConfiguration.java | 10 +++---
.../ShardingShadowDatabasesConfiguration.java | 6 ++--
...dingDatabasesAndTablesConfigurationPrecise.java | 9 +++---
...ardingDatabasesAndTablesConfigurationRange.java | 9 +++---
.../ShardingDatabasesConfigurationPrecise.java | 7 ++---
.../ShardingDatabasesConfigurationRange.java | 7 ++---
.../ShardingMasterSlaveConfigurationPrecise.java | 9 +++---
.../ShardingMasterSlaveConfigurationRange.java | 9 +++---
.../config/ShardingTablesConfigurationPrecise.java | 7 ++---
.../config/ShardingTablesConfigurationRange.java | 7 ++---
.../core/configcenter/ConfigCenterTest.java | 18 +++++------
.../listener/SchemaChangedListenerTest.java | 4 +--
.../api/config/EncryptRuleConfiguration.java | 4 +--
.../algorithm/EncryptAlgorithmConfiguration.java | 32 -------------------
.../config/EncryptAlgorithmConfigurationTest.java | 8 ++---
.../EncryptRuleConfigurationYamlSwapper.java | 6 ++--
.../EncryptAlgorithmConfigurationYamlSwapper.java | 10 +++---
.../log/EncryptConfigurationLoggerTest.java | 4 +--
.../encrypt/rule/EncryptRuleTest.java | 4 +--
.../api/config/MasterSlaveRuleConfiguration.java | 4 +--
.../LoadBalanceAlgorithmConfiguration.java | 32 -------------------
.../MasterSlaveRuleConfigurationYamlSwapper.java | 8 ++---
.../masterslave/rule/MasterSlaveRuleTest.java | 4 +--
...asterSlaveRuleConfigurationYamlSwapperTest.java | 6 ++--
.../api/config/ShardingRuleConfiguration.java | 7 ++---
.../KeyGenerateAlgorithmConfiguration.java | 32 -------------------
...yGenerateAlgorithmConfigurationYamlSwapper.java | 10 +++---
.../ShardingAlgorithmConfigurationYamlSwapper.java | 10 +++---
.../sharding/rule/ShardingRuleTest.java | 17 +++++-----
...erateAlgorithmConfigurationYamlSwapperTest.java | 6 ++--
.../route/fixture/AbstractRoutingEngineTest.java | 36 +++++++++++-----------
.../ShardingSphereAlgorithmConfiguration.java | 8 ++---
.../OrchestrationShardingSphereDataSourceTest.java | 5 +--
.../type/OrchestrationSpringBootEncryptTest.java | 6 ++--
...OrchestrationSpringBootRegistryEncryptTest.java | 6 ++--
41 files changed, 152 insertions(+), 261 deletions(-)
diff --git a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalEncryptConfiguration.java b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalEncryptConfiguration.java
index 7d89d0a..49668e7 100644
--- a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalEncryptConfiguration.java
+++ b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalEncryptConfiguration.java
@@ -20,11 +20,11 @@ package org.apache.shardingsphere.example.orchestration.raw.jdbc.config.local;
import com.google.common.collect.ImmutableMap;
import org.apache.shardingsphere.driver.orchestration.api.OrchestrationShardingSphereDataSourceFactory;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.orchestration.center.config.CenterConfiguration;
import org.apache.shardingsphere.orchestration.center.config.OrchestrationConfiguration;
@@ -61,9 +61,9 @@ public final class LocalEncryptConfiguration implements ExampleConfiguration {
return new EncryptTableRuleConfiguration("t_order", Collections.singleton(encryptColumnRuleConfiguration));
}
- private EncryptAlgorithmConfiguration createEncryptAlgorithmConfiguration() {
+ private ShardingSphereAlgorithmConfiguration createEncryptAlgorithmConfiguration() {
Properties props = new Properties();
props.setProperty("aes.key.value", "123456");
- return new EncryptAlgorithmConfiguration("AES", props);
+ return new ShardingSphereAlgorithmConfiguration("AES", props);
}
}
diff --git a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingDatabasesAndTablesConfiguration.java b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingDatabasesAndTablesConfiguration.java
index 9d52f88..d7beeb8 100644
--- a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingDatabasesAndTablesConfiguration.java
+++ b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingDatabasesAndTablesConfiguration.java
@@ -20,11 +20,10 @@ package org.apache.shardingsphere.example.orchestration.raw.jdbc.config.local;
import org.apache.shardingsphere.driver.orchestration.api.OrchestrationShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.orchestration.center.config.CenterConfiguration;
import org.apache.shardingsphere.orchestration.center.config.OrchestrationConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -64,9 +63,9 @@ public final class LocalShardingDatabasesAndTablesConfiguration implements Examp
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
Properties props = new Properties();
props.setProperty("algorithm.expression", "demo_ds_${user_id % 2}");
- result.getShardingAlgorithms() .put("inline", new ShardingAlgorithmConfiguration("INLINE", props));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
+ result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingDatabasesConfiguration.java b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingDatabasesConfiguration.java
index 171487c..93924a7 100644
--- a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingDatabasesConfiguration.java
+++ b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingDatabasesConfiguration.java
@@ -20,11 +20,10 @@ package org.apache.shardingsphere.example.orchestration.raw.jdbc.config.local;
import org.apache.shardingsphere.driver.orchestration.api.OrchestrationShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.orchestration.center.config.CenterConfiguration;
import org.apache.shardingsphere.orchestration.center.config.OrchestrationConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -63,8 +62,8 @@ public final class LocalShardingDatabasesConfiguration implements ExampleConfigu
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "inline"));
Properties props = new Properties();
props.setProperty("algorithm.expression", "demo_ds_${user_id % 2}");
- result.getShardingAlgorithms() .put("inline", new ShardingAlgorithmConfiguration("INLINE", props));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProps()));
+ result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProps()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingMasterSlaveConfiguration.java b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingMasterSlaveConfiguration.java
index 2c24d74..6b7e8f2 100644
--- a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingMasterSlaveConfiguration.java
+++ b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingMasterSlaveConfiguration.java
@@ -21,13 +21,12 @@ import org.apache.shardingsphere.driver.orchestration.api.OrchestrationShardingS
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
import org.apache.shardingsphere.orchestration.center.config.CenterConfiguration;
import org.apache.shardingsphere.orchestration.center.config.OrchestrationConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -67,9 +66,9 @@ public final class LocalShardingMasterSlaveConfiguration implements ExampleConfi
result.getBroadcastTables().add("t_address");
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "standard_test_db"));
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- result.getShardingAlgorithms() .put("standard_test_db", new ShardingAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("standard_test_db", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
+ result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingTablesConfiguration.java b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingTablesConfiguration.java
index 4d68a3c..9ec965f 100644
--- a/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingTablesConfiguration.java
+++ b/examples/shardingsphere-jdbc-example/orchestration-example/orchestration-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/orchestration/raw/jdbc/config/local/LocalShardingTablesConfiguration.java
@@ -20,11 +20,10 @@ package org.apache.shardingsphere.example.orchestration.raw.jdbc.config.local;
import org.apache.shardingsphere.driver.orchestration.api.OrchestrationShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.orchestration.center.config.CenterConfiguration;
import org.apache.shardingsphere.orchestration.center.config.OrchestrationConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -57,8 +56,8 @@ public final class LocalShardingTablesConfiguration implements ExampleConfigurat
result.getBindingTableGroups().add("t_order, t_order_item");
result.getBroadcastTables().add("t_address");
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/config/EncryptDatabasesConfiguration.java b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/config/EncryptDatabasesConfiguration.java
index 979d7f1..8d03a7a 100644
--- a/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/config/EncryptDatabasesConfiguration.java
+++ b/examples/shardingsphere-jdbc-example/other-feature-example/encrypt-example/encrypt-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/encrypt/table/raw/jdbc/config/EncryptDatabasesConfiguration.java
@@ -19,11 +19,11 @@ package org.apache.shardingsphere.example.encrypt.table.raw.jdbc.config;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import javax.sql.DataSource;
import java.sql.SQLException;
@@ -43,9 +43,9 @@ public final class EncryptDatabasesConfiguration implements ExampleConfiguration
EncryptColumnRuleConfiguration columnConfigAes = new EncryptColumnRuleConfiguration("user_name", "user_name", "", "user_name_plain", "name_encryptor");
EncryptColumnRuleConfiguration columnConfigTest = new EncryptColumnRuleConfiguration("pwd", "pwd", "assisted_query_pwd", "", "pwd_encryptor");
EncryptTableRuleConfiguration encryptTableRuleConfiguration = new EncryptTableRuleConfiguration("t_user", Arrays.asList(columnConfigAes, columnConfigTest));
- Map<String, EncryptAlgorithmConfiguration> encryptAlgorithmConfigurations = new LinkedHashMap<>(2, 1);
- encryptAlgorithmConfigurations.put("name_encryptor", new EncryptAlgorithmConfiguration("AES", props));
- encryptAlgorithmConfigurations.put("pwd_encryptor", new EncryptAlgorithmConfiguration("assistedTest", props));
+ Map<String, ShardingSphereAlgorithmConfiguration> encryptAlgorithmConfigurations = new LinkedHashMap<>(2, 1);
+ encryptAlgorithmConfigurations.put("name_encryptor", new ShardingSphereAlgorithmConfiguration("AES", props));
+ encryptAlgorithmConfigurations.put("pwd_encryptor", new ShardingSphereAlgorithmConfiguration("assistedTest", props));
EncryptRuleConfiguration encryptRuleConfiguration = new EncryptRuleConfiguration(Collections.singleton(encryptTableRuleConfiguration), encryptAlgorithmConfigurations);
try {
return ShardingSphereDataSourceFactory.createDataSource(DataSourceUtil.createDataSource("demo_ds"), Collections.singleton(encryptRuleConfiguration), props);
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/table/raw/jdbc/config/EncryptShadowDatabasesConfiguration.java b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/table/raw/jdbc/config/EncryptShadowDatabasesConfiguration.java
index fcf5e87..def5ab4 100644
--- a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/table/raw/jdbc/config/EncryptShadowDatabasesConfiguration.java
+++ b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/table/raw/jdbc/config/EncryptShadowDatabasesConfiguration.java
@@ -21,9 +21,9 @@ import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import javax.sql.DataSource;
@@ -61,12 +61,12 @@ public final class EncryptShadowDatabasesConfiguration implements ExampleConfigu
return result;
}
- private Map<String, EncryptAlgorithmConfiguration> getEncryptAlgorithmConfigurations() {
- Map<String, EncryptAlgorithmConfiguration> result = new LinkedHashMap<>(2, 1);
+ private Map<String, ShardingSphereAlgorithmConfiguration> getEncryptAlgorithmConfigurations() {
+ Map<String, ShardingSphereAlgorithmConfiguration> result = new LinkedHashMap<>(2, 1);
Properties props = new Properties();
props.setProperty("aes.key.value", "123456");
- result.put("name_encryptor", new EncryptAlgorithmConfiguration("AES", props));
- result.put("pwd_encryptor", new EncryptAlgorithmConfiguration("assistedTest", null));
+ result.put("name_encryptor", new ShardingSphereAlgorithmConfiguration("AES", props));
+ result.put("pwd_encryptor", new ShardingSphereAlgorithmConfiguration("assistedTest", null));
return result;
}
}
diff --git a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/table/raw/jdbc/config/ShardingShadowDatabasesConfiguration.java b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/table/raw/jdbc/config/ShardingShadowDatabasesConfiguration.java
index 1821635..ac19cb4 100644
--- a/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/table/raw/jdbc/config/ShardingShadowDatabasesConfiguration.java
+++ b/examples/shardingsphere-jdbc-example/other-feature-example/shadow-example/shadow-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/shadow/table/raw/jdbc/config/ShardingShadowDatabasesConfiguration.java
@@ -20,9 +20,9 @@ package org.apache.shardingsphere.example.shadow.table.raw.jdbc.config;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.strategy.algorithm.sharding.inline.InlineShardingAlgorithm;
@@ -50,10 +50,10 @@ public final class ShardingShadowDatabasesConfiguration implements ExampleConfig
shardingRuleConfiguration.getTables().add(getUserTableConfiguration());
Properties props = new Properties();
props.setProperty("algorithm.expression", "ds_${user_id % 2}");
- shardingRuleConfiguration.getShardingAlgorithms() .put("database_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfiguration.getShardingAlgorithms() .put("database_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_user");
- shardingRuleConfiguration.getShardingAlgorithms() .put("table_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfiguration.getShardingAlgorithms() .put("table_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props.setProperty("sql.show", "true");
ShadowRuleConfiguration shadowRuleConfiguration = new ShadowRuleConfiguration("shadow", shadowMappings);
return ShardingSphereDataSourceFactory.createDataSource(dataSourceMap, Arrays.asList(shadowRuleConfiguration, shardingRuleConfiguration), props);
diff --git a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesAndTablesConfigurationPrecise.java b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesAndTablesConfigurationPrecise.java
index 2bed9dc..c0e8163 100644
--- a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesAndTablesConfigurationPrecise.java
+++ b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesAndTablesConfigurationPrecise.java
@@ -20,9 +20,8 @@ package org.apache.shardingsphere.example.sharding.raw.jdbc.config;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -51,9 +50,9 @@ public final class ShardingDatabasesAndTablesConfigurationPrecise implements Exa
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
Properties props = new Properties();
props.setProperty("algorithm.expression", "demo_ds_${user_id % 2}");
- result.getShardingAlgorithms() .put("inline", new ShardingAlgorithmConfiguration("INLINE", props));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
+ result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesAndTablesConfigurationRange.java b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesAndTablesConfigurationRange.java
index 6a90986..6982780 100644
--- a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesAndTablesConfigurationRange.java
+++ b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesAndTablesConfigurationRange.java
@@ -20,9 +20,8 @@ package org.apache.shardingsphere.example.sharding.raw.jdbc.config;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -49,9 +48,9 @@ public final class ShardingDatabasesAndTablesConfigurationRange implements Examp
result.getBroadcastTables().add("t_address");
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "standard_test_db"));
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- result.getShardingAlgorithms() .put("standard_test_db", new ShardingAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("standard_test_db", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
+ result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesConfigurationPrecise.java b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesConfigurationPrecise.java
index d4cc937..a2c58b4 100644
--- a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesConfigurationPrecise.java
+++ b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesConfigurationPrecise.java
@@ -20,9 +20,8 @@ package org.apache.shardingsphere.example.sharding.raw.jdbc.config;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -49,8 +48,8 @@ public final class ShardingDatabasesConfigurationPrecise implements ExampleConfi
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "inline"));
Properties props = new Properties();
props.setProperty("algorithm.expression", "demo_ds_${user_id % 2}");
- result.getShardingAlgorithms() .put("inline", new ShardingAlgorithmConfiguration("INLINE", props));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesConfigurationRange.java b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesConfigurationRange.java
index 358f5cf..af799a9 100644
--- a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesConfigurationRange.java
+++ b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingDatabasesConfigurationRange.java
@@ -21,9 +21,8 @@ import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -52,8 +51,8 @@ public final class ShardingDatabasesConfigurationRange implements ExampleConfigu
result.getTables().add(getOrderItemTableRuleConfiguration());
result.getBroadcastTables().add("t_address");
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "standard_test_db"));
- result.getShardingAlgorithms() .put("standard_test_db", new ShardingAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("standard_test_db", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingMasterSlaveConfigurationPrecise.java b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingMasterSlaveConfigurationPrecise.java
index 12fdfc6..8990b4e 100644
--- a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingMasterSlaveConfigurationPrecise.java
+++ b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingMasterSlaveConfigurationPrecise.java
@@ -20,11 +20,10 @@ package org.apache.shardingsphere.example.sharding.raw.jdbc.config;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -63,9 +62,9 @@ public final class ShardingMasterSlaveConfigurationPrecise implements ExampleCon
result.getBroadcastTables().add("t_address");
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "standard_test_db"));
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- result.getShardingAlgorithms() .put("standard_test_db", new ShardingAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("standard_test_db", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
+ result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingMasterSlaveConfigurationRange.java b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingMasterSlaveConfigurationRange.java
index 1e71672..1da46c1 100644
--- a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingMasterSlaveConfigurationRange.java
+++ b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingMasterSlaveConfigurationRange.java
@@ -20,11 +20,10 @@ package org.apache.shardingsphere.example.sharding.raw.jdbc.config;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -63,9 +62,9 @@ public final class ShardingMasterSlaveConfigurationRange implements ExampleConfi
result.getBroadcastTables().add("t_address");
result.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("user_id", "standard_test_db"));
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- result.getShardingAlgorithms() .put("standard_test_db", new ShardingAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("standard_test_db", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_DB", new Properties()));
+ result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingTablesConfigurationPrecise.java b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingTablesConfigurationPrecise.java
index 38c8c80..4daf3ec 100644
--- a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingTablesConfigurationPrecise.java
+++ b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingTablesConfigurationPrecise.java
@@ -20,9 +20,8 @@ package org.apache.shardingsphere.example.sharding.raw.jdbc.config;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -48,8 +47,8 @@ public final class ShardingTablesConfigurationPrecise implements ExampleConfigur
result.getBindingTableGroups().add("t_order, t_order_item");
result.getBroadcastTables().add("t_address");
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingTablesConfigurationRange.java b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingTablesConfigurationRange.java
index ab771b8..56bbfbd 100644
--- a/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingTablesConfigurationRange.java
+++ b/examples/shardingsphere-jdbc-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/config/ShardingTablesConfigurationRange.java
@@ -20,9 +20,8 @@ package org.apache.shardingsphere.example.sharding.raw.jdbc.config;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.example.config.ExampleConfiguration;
import org.apache.shardingsphere.example.core.api.DataSourceUtil;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.StandardShardingStrategyConfiguration;
@@ -48,8 +47,8 @@ public final class ShardingTablesConfigurationRange implements ExampleConfigurat
result.getBindingTableGroups().add("t_order, t_order_item");
result.getBroadcastTables().add("t_address");
result.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("order_id", "standard_test_tbl"));
- result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
- result.getKeyGenerators().put("snowflake", new KeyGenerateAlgorithmConfiguration("SNOWFLAKE", getProperties()));
+ result.getShardingAlgorithms() .put("standard_test_tbl", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST_TBL", new Properties()));
+ result.getKeyGenerators().put("snowflake", new ShardingSphereAlgorithmConfiguration("SNOWFLAKE", getProperties()));
return result;
}
diff --git a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-configcenter/src/test/java/org/apache/shardingsphere/orchestration/core/configcenter/ConfigCenterTest.java b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-configcenter/src/test/java/org/apache/shardingsphere/orchestration/core/configcenter/ConfigCenterTest.java
index 293cabb..e082c52 100644
--- a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-configcenter/src/test/java/org/apache/shardingsphere/orchestration/core/configcenter/ConfigCenterTest.java
+++ b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-configcenter/src/test/java/org/apache/shardingsphere/orchestration/core/configcenter/ConfigCenterTest.java
@@ -19,22 +19,22 @@ package org.apache.shardingsphere.orchestration.core.configcenter;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.metrics.configuration.config.MetricsConfiguration;
-import org.apache.shardingsphere.orchestration.center.ConfigCenterRepository;
-import org.apache.shardingsphere.orchestration.core.configuration.YamlDataSourceConfiguration;
-import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.infra.auth.Authentication;
import org.apache.shardingsphere.infra.auth.yaml.config.YamlAuthenticationConfiguration;
import org.apache.shardingsphere.infra.auth.yaml.swapper.AuthenticationYamlSwapper;
import org.apache.shardingsphere.infra.config.DataSourceConfiguration;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.yaml.config.YamlRootRuleConfigurations;
import org.apache.shardingsphere.infra.yaml.engine.YamlEngine;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapperEngine;
+import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
+import org.apache.shardingsphere.metrics.configuration.config.MetricsConfiguration;
+import org.apache.shardingsphere.orchestration.center.ConfigCenterRepository;
+import org.apache.shardingsphere.orchestration.core.configuration.YamlDataSourceConfiguration;
+import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
+import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -474,7 +474,7 @@ public final class ConfigCenterTest {
} else if (each instanceof EncryptRuleConfiguration) {
EncryptRuleConfiguration encryptRuleConfiguration = (EncryptRuleConfiguration) each;
assertThat(encryptRuleConfiguration.getEncryptors().size(), is(2));
- EncryptAlgorithmConfiguration encryptAlgorithmConfiguration = encryptRuleConfiguration.getEncryptors().get("aes_encryptor");
+ ShardingSphereAlgorithmConfiguration encryptAlgorithmConfiguration = encryptRuleConfiguration.getEncryptors().get("aes_encryptor");
assertThat(encryptAlgorithmConfiguration.getType(), is("AES"));
assertThat(encryptAlgorithmConfiguration.getProps().get("aes.key.value").toString(), is("123456abcd"));
}
@@ -509,7 +509,7 @@ public final class ConfigCenterTest {
ConfigCenter configurationService = new ConfigCenter("test", configCenterRepository);
EncryptRuleConfiguration actual = (EncryptRuleConfiguration) configurationService.loadRuleConfigurations("sharding_db").iterator().next();
assertThat(actual.getEncryptors().size(), is(1));
- EncryptAlgorithmConfiguration encryptAlgorithmConfiguration = actual.getEncryptors().get("order_encryptor");
+ ShardingSphereAlgorithmConfiguration encryptAlgorithmConfiguration = actual.getEncryptors().get("order_encryptor");
assertThat(encryptAlgorithmConfiguration.getType(), is("AES"));
assertThat(encryptAlgorithmConfiguration.getProps().get("aes.key.value").toString(), is("123456"));
}
diff --git a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-configcenter/src/test/java/org/apache/shardingsphere/orchestration/core/configcenter/listener/SchemaChangedListenerTest.java b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-configcenter/src/test/java/org/apache/shardingsphere/orchestration/core/configcenter/listener/SchemaC [...]
index f814312..7bf40f3 100644
--- a/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-configcenter/src/test/java/org/apache/shardingsphere/orchestration/core/configcenter/listener/SchemaChangedListenerTest.java
+++ b/shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-configcenter/src/test/java/org/apache/shardingsphere/orchestration/core/configcenter/listener/SchemaChangedListenerTest.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.orchestration.core.configcenter.listener;
import lombok.SneakyThrows;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
import org.apache.shardingsphere.orchestration.center.ConfigCenterRepository;
import org.apache.shardingsphere.orchestration.center.listener.DataChangedEvent;
@@ -123,7 +123,7 @@ public final class SchemaChangedListenerTest {
assertThat(event.getRuleConfigurations().iterator().next(), instanceOf(EncryptRuleConfiguration.class));
EncryptRuleConfiguration encryptRuleConfiguration = (EncryptRuleConfiguration) event.getRuleConfigurations().iterator().next();
assertThat(encryptRuleConfiguration.getEncryptors().size(), is(1));
- EncryptAlgorithmConfiguration encryptAlgorithmConfiguration = encryptRuleConfiguration.getEncryptors().get("order_encryptor");
+ ShardingSphereAlgorithmConfiguration encryptAlgorithmConfiguration = encryptRuleConfiguration.getEncryptors().get("order_encryptor");
assertThat(encryptAlgorithmConfiguration.getType(), is("AES"));
assertThat(encryptAlgorithmConfiguration.getProps().get("aes.key.value").toString(), is("123456"));
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/EncryptRuleConfiguration.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/EncryptRuleConfiguration.java
index bd075e5..98950de 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/EncryptRuleConfiguration.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/EncryptRuleConfiguration.java
@@ -19,9 +19,9 @@ package org.apache.shardingsphere.encrypt.api.config;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import java.util.Collection;
import java.util.Map;
@@ -35,5 +35,5 @@ public final class EncryptRuleConfiguration implements RuleConfiguration {
private final Collection<EncryptTableRuleConfiguration> tables;
- private final Map<String, EncryptAlgorithmConfiguration> encryptors;
+ private final Map<String, ShardingSphereAlgorithmConfiguration> encryptors;
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/algorithm/EncryptAlgorithmConfiguration.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/algorithm/EncryptAlgorithmConfiguration.java
deleted file mode 100644
index e76cedb..0000000
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/algorithm/EncryptAlgorithmConfiguration.java
+++ /dev/null
@@ -1,32 +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.encrypt.api.config.algorithm;
-
-import org.apache.shardingsphere.infra.config.TypedSPIConfiguration;
-
-import java.util.Properties;
-
-/**
- * Encrypt algorithm configuration.
- */
-public final class EncryptAlgorithmConfiguration extends TypedSPIConfiguration {
-
- public EncryptAlgorithmConfiguration(final String type, final Properties props) {
- super(type, props);
- }
-}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/test/java/org/apache/shardingsphere/encrypt/api/config/EncryptAlgorithmConfigurationTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/test/java/org/apache/shardingsphere/encrypt/api/config/EncryptAlgorithmConfigurationTest.java
index e0ee8e5..4706bd3 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/test/java/org/apache/shardingsphere/encrypt/api/config/EncryptAlgorithmConfigurationTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/test/java/org/apache/shardingsphere/encrypt/api/config/EncryptAlgorithmConfigurationTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.encrypt.api.config;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.junit.Test;
import java.util.Properties;
@@ -29,12 +29,12 @@ public final class EncryptAlgorithmConfigurationTest {
@Test(expected = IllegalArgumentException.class)
public void assertConstructorWithoutType() {
- new EncryptAlgorithmConfiguration(null, new Properties());
+ new ShardingSphereAlgorithmConfiguration(null, new Properties());
}
@Test
public void assertConstructorWithoutProperties() {
- EncryptAlgorithmConfiguration actual = new EncryptAlgorithmConfiguration("TEST", new Properties());
+ ShardingSphereAlgorithmConfiguration actual = new ShardingSphereAlgorithmConfiguration("TEST", new Properties());
assertThat(actual.getType(), is("TEST"));
assertThat(actual.getProps(), is(new Properties()));
}
@@ -43,7 +43,7 @@ public final class EncryptAlgorithmConfigurationTest {
public void assertConstructorWithProperties() {
Properties props = new Properties();
props.setProperty("key", "value");
- EncryptAlgorithmConfiguration actual = new EncryptAlgorithmConfiguration("TEST", props);
+ ShardingSphereAlgorithmConfiguration actual = new ShardingSphereAlgorithmConfiguration("TEST", props);
assertThat(actual.getType(), is("TEST"));
assertThat(actual.getProps(), is(props));
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapper.java
index 01818ad..dc22add 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapper.java
@@ -18,13 +18,13 @@
package org.apache.shardingsphere.encrypt.yaml.swapper;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
import org.apache.shardingsphere.encrypt.constant.EncryptOrder;
import org.apache.shardingsphere.encrypt.yaml.config.YamlEncryptRuleConfiguration;
import org.apache.shardingsphere.encrypt.yaml.config.rule.YamlEncryptTableRuleConfiguration;
import org.apache.shardingsphere.encrypt.yaml.swapper.algorithm.EncryptAlgorithmConfigurationYamlSwapper;
import org.apache.shardingsphere.encrypt.yaml.swapper.rule.EncryptTableRuleConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
@@ -66,8 +66,8 @@ public final class EncryptRuleConfigurationYamlSwapper implements YamlRuleConfig
return result;
}
- private Map<String, EncryptAlgorithmConfiguration> swapEncryptAlgorithm(final YamlEncryptRuleConfiguration yamlConfiguration) {
- Map<String, EncryptAlgorithmConfiguration> result = new LinkedHashMap<>();
+ private Map<String, ShardingSphereAlgorithmConfiguration> swapEncryptAlgorithm(final YamlEncryptRuleConfiguration yamlConfiguration) {
+ Map<String, ShardingSphereAlgorithmConfiguration> result = new LinkedHashMap<>();
for (Entry<String, YamlShardingSphereAlgorithmConfiguration> entry : yamlConfiguration.getEncryptors().entrySet()) {
YamlShardingSphereAlgorithmConfiguration yamlEncryptAlgorithmConfiguration = entry.getValue();
result.put(entry.getKey(), encryptAlgorithmConfigurationYamlSwapper.swap(yamlEncryptAlgorithmConfiguration));
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/algorithm/EncryptAlgorithmConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/algorithm/EncryptAlgorithmConfigurationYamlSwapper.java
index 83bd633..d6fc3df 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/algorithm/EncryptAlgorithmConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/algorithm/EncryptAlgorithmConfigurationYamlSwapper.java
@@ -17,17 +17,17 @@
package org.apache.shardingsphere.encrypt.yaml.swapper.algorithm;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.swapper.YamlSwapper;
/**
* Encrypt algorithm configuration YAML swapper.
*/
-public final class EncryptAlgorithmConfigurationYamlSwapper implements YamlSwapper<YamlShardingSphereAlgorithmConfiguration, EncryptAlgorithmConfiguration> {
+public final class EncryptAlgorithmConfigurationYamlSwapper implements YamlSwapper<YamlShardingSphereAlgorithmConfiguration, ShardingSphereAlgorithmConfiguration> {
@Override
- public YamlShardingSphereAlgorithmConfiguration swap(final EncryptAlgorithmConfiguration data) {
+ public YamlShardingSphereAlgorithmConfiguration swap(final ShardingSphereAlgorithmConfiguration data) {
YamlShardingSphereAlgorithmConfiguration result = new YamlShardingSphereAlgorithmConfiguration();
result.setType(data.getType());
result.setProps(data.getProps());
@@ -35,7 +35,7 @@ public final class EncryptAlgorithmConfigurationYamlSwapper implements YamlSwapp
}
@Override
- public EncryptAlgorithmConfiguration swap(final YamlShardingSphereAlgorithmConfiguration yamlConfiguration) {
- return new EncryptAlgorithmConfiguration(yamlConfiguration.getType(), yamlConfiguration.getProps());
+ public ShardingSphereAlgorithmConfiguration swap(final YamlShardingSphereAlgorithmConfiguration yamlConfiguration) {
+ return new ShardingSphereAlgorithmConfiguration(yamlConfiguration.getType(), yamlConfiguration.getProps());
}
}
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/test/java/org/apache/shardingsphere/encrypt/log/EncryptConfigurationLoggerTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/test/java/org/apache/shardingsphere/encrypt/log/EncryptConfigurationLoggerTest.java
index 0d6c8db..d57ef9e 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/test/java/org/apache/shardingsphere/encrypt/log/EncryptConfigurationLoggerTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/test/java/org/apache/shardingsphere/encrypt/log/EncryptConfigurationLoggerTest.java
@@ -20,9 +20,9 @@ package org.apache.shardingsphere.encrypt.log;
import com.google.common.collect.ImmutableMap;
import lombok.SneakyThrows;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.log.ConfigurationLogger;
import org.junit.Before;
import org.junit.Test;
@@ -86,7 +86,7 @@ public final class EncryptConfigurationLoggerTest {
private EncryptRuleConfiguration getEncryptConfiguration() {
Properties props = new Properties();
props.put("aes.key.value", "123456abc");
- EncryptAlgorithmConfiguration encryptAlgorithmConfiguration = new EncryptAlgorithmConfiguration("AES", props);
+ ShardingSphereAlgorithmConfiguration encryptAlgorithmConfiguration = new ShardingSphereAlgorithmConfiguration("AES", props);
EncryptTableRuleConfiguration encryptTableRuleConfiguration = new EncryptTableRuleConfiguration(
"t_encrypt", Collections.singleton(new EncryptColumnRuleConfiguration("user_id", "user_encrypt", "user_assisted", "user_decrypt", "aes_encryptor")));
return new EncryptRuleConfiguration(Collections.singleton(encryptTableRuleConfiguration), ImmutableMap.of("aes_encryptor", encryptAlgorithmConfiguration));
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java
index 97b4dc6..ff534c4 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-common/src/test/java/org/apache/shardingsphere/encrypt/rule/EncryptRuleTest.java
@@ -19,9 +19,9 @@ package org.apache.shardingsphere.encrypt.rule;
import com.google.common.collect.ImmutableMap;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.junit.Before;
import org.junit.Test;
@@ -51,7 +51,7 @@ public final class EncryptRuleTest {
Properties props = new Properties();
EncryptColumnRuleConfiguration columnConfig = new EncryptColumnRuleConfiguration(column, "cipher_pwd", "", "plain_pwd", "aes");
EncryptColumnRuleConfiguration idNumberConfig = new EncryptColumnRuleConfiguration(idNumber, "cipher_id_number", "", "plain_id_number", "aes");
- EncryptAlgorithmConfiguration encryptAlgorithmConfiguration = new EncryptAlgorithmConfiguration("assistedTest", props);
+ ShardingSphereAlgorithmConfiguration encryptAlgorithmConfiguration = new ShardingSphereAlgorithmConfiguration("assistedTest", props);
EncryptTableRuleConfiguration tableConfig = new EncryptTableRuleConfiguration(table, Arrays.asList(columnConfig, idNumberConfig));
encryptRuleConfig = new EncryptRuleConfiguration(Collections.singleton(tableConfig), ImmutableMap.of("aes", encryptAlgorithmConfiguration));
}
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
index 7b43f98..13aaf14 100644
--- 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
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.masterslave.api.config;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.algorithm.LoadBalanceAlgorithmConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
import java.util.Collection;
@@ -35,5 +35,5 @@ public final class MasterSlaveRuleConfiguration implements RuleConfiguration {
private final Collection<MasterSlaveDataSourceRuleConfiguration> dataSources;
- private final Map<String, LoadBalanceAlgorithmConfiguration> loadBalancers;
+ 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/algorithm/LoadBalanceAlgorithmConfiguration.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/api/config/algorithm/LoadBalanceAlgorithmConfiguration.java
deleted file mode 100644
index b124142..0000000
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-api/src/main/java/org/apache/shardingsphere/masterslave/api/config/algorithm/LoadBalanceAlgorithmConfiguration.java
+++ /dev/null
@@ -1,32 +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.algorithm;
-
-import org.apache.shardingsphere.infra.config.TypedSPIConfiguration;
-
-import java.util.Properties;
-
-/**
- * Master-slave load balance algorithm configuration.
- */
-public final class LoadBalanceAlgorithmConfiguration extends TypedSPIConfiguration {
-
- public LoadBalanceAlgorithmConfiguration(final String type, final Properties props) {
- super(type, props);
- }
-}
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
index a5c1d5d..ecf4a3e 100644
--- 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
@@ -17,10 +17,10 @@
package org.apache.shardingsphere.masterslave.yaml.swapper;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.swapper.YamlRuleConfigurationSwapper;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.algorithm.LoadBalanceAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
import org.apache.shardingsphere.masterslave.constant.MasterSlaveOrder;
import org.apache.shardingsphere.masterslave.yaml.config.YamlMasterSlaveRuleConfiguration;
@@ -60,7 +60,7 @@ public final class MasterSlaveRuleConfigurationYamlSwapper implements YamlRuleCo
for (Entry<String, YamlMasterSlaveDataSourceRuleConfiguration> entry : yamlConfiguration.getDataSources().entrySet()) {
dataSources.add(swap(entry.getKey(), entry.getValue()));
}
- Map<String, LoadBalanceAlgorithmConfiguration> loadBalancers = new LinkedHashMap<>(yamlConfiguration.getLoadBalancers().entrySet().size(), 1);
+ Map<String, ShardingSphereAlgorithmConfiguration> loadBalancers = new LinkedHashMap<>(yamlConfiguration.getLoadBalancers().entrySet().size(), 1);
for (Entry<String, YamlShardingSphereAlgorithmConfiguration> entry : yamlConfiguration.getLoadBalancers().entrySet()) {
loadBalancers.put(entry.getKey(), swap(entry.getValue()));
}
@@ -72,8 +72,8 @@ public final class MasterSlaveRuleConfigurationYamlSwapper implements YamlRuleCo
yamlDataSourceRuleConfiguration.getMasterDataSourceName(), yamlDataSourceRuleConfiguration.getSlaveDataSourceNames(), yamlDataSourceRuleConfiguration.getLoadBalancerName());
}
- private LoadBalanceAlgorithmConfiguration swap(final YamlShardingSphereAlgorithmConfiguration yamlLoadBalanceAlgorithmConfiguration) {
- return new LoadBalanceAlgorithmConfiguration(yamlLoadBalanceAlgorithmConfiguration.getType(), yamlLoadBalanceAlgorithmConfiguration.getProps());
+ private ShardingSphereAlgorithmConfiguration swap(final YamlShardingSphereAlgorithmConfiguration yamlLoadBalanceAlgorithmConfiguration) {
+ return new ShardingSphereAlgorithmConfiguration(yamlLoadBalanceAlgorithmConfiguration.getType(), yamlLoadBalanceAlgorithmConfiguration.getProps());
}
@Override
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
index dd025c4..6b47e01 100644
--- 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
@@ -18,9 +18,9 @@
package org.apache.shardingsphere.masterslave.rule;
import com.google.common.collect.ImmutableMap;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.algorithm.LoadBalanceAlgorithmConfiguration;
import org.junit.Test;
import java.util.Arrays;
@@ -54,7 +54,7 @@ public final class MasterSlaveRuleTest {
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 LoadBalanceAlgorithmConfiguration("RANDOM", new Properties()))));
+ Collections.singleton(configuration), ImmutableMap.of("random", new ShardingSphereAlgorithmConfiguration("RANDOM", new Properties()))));
}
private void assertDataSourceRule(final MasterSlaveDataSourceRule actual) {
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-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleConfigurationYamlSwapperTest.java
index 70a51a7..f2e30a7 100644
--- 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-master-slave/shardingsphere-master-slave-common/src/test/java/org/apache/shardingsphere/masterslave/yaml/swapper/MasterSlaveRuleConfigurationYamlSwapperTest.java
@@ -18,11 +18,11 @@
package org.apache.shardingsphere.masterslave.yaml.swapper;
import com.google.common.collect.ImmutableMap;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.algorithm.LoadBalanceAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
-import org.apache.shardingsphere.masterslave.yaml.config.rule.YamlMasterSlaveDataSourceRuleConfiguration;
import org.apache.shardingsphere.masterslave.yaml.config.YamlMasterSlaveRuleConfiguration;
+import org.apache.shardingsphere.masterslave.yaml.config.rule.YamlMasterSlaveDataSourceRuleConfiguration;
import org.junit.Test;
import java.util.Arrays;
@@ -39,7 +39,7 @@ public final class MasterSlaveRuleConfigurationYamlSwapperTest {
public void assertSwapToYamlWithLoadBalanceAlgorithm() {
MasterSlaveDataSourceRuleConfiguration dataSourceConfiguration = new MasterSlaveDataSourceRuleConfiguration("ds", "master", Collections.singletonList("slave"), "roundRobin");
YamlMasterSlaveRuleConfiguration actual = new MasterSlaveRuleConfigurationYamlSwapper().swap(new MasterSlaveRuleConfiguration(
- Collections.singleton(dataSourceConfiguration), ImmutableMap.of("roundRobin", new LoadBalanceAlgorithmConfiguration("ROUND_ROBIN", new Properties()))));
+ Collections.singleton(dataSourceConfiguration), ImmutableMap.of("roundRobin", new ShardingSphereAlgorithmConfiguration("ROUND_ROBIN", new Properties()))));
assertThat(actual.getDataSources().get("ds").getName(), is("ds"));
assertThat(actual.getDataSources().get("ds").getMasterDataSourceName(), is("master"));
assertThat(actual.getDataSources().get("ds").getSlaveDataSourceNames(), is(Collections.singletonList("slave")));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/ShardingRuleConfiguration.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/ShardingRuleConfiguration.java
index 5b41c74..a64bdb8 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/ShardingRuleConfiguration.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/ShardingRuleConfiguration.java
@@ -20,8 +20,7 @@ package org.apache.shardingsphere.sharding.api.config;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingAutoTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
@@ -53,7 +52,7 @@ public final class ShardingRuleConfiguration implements RuleConfiguration {
private KeyGenerateStrategyConfiguration defaultKeyGenerateStrategy;
- private Map<String, ShardingAlgorithmConfiguration> shardingAlgorithms = new LinkedHashMap<>();
+ private Map<String, ShardingSphereAlgorithmConfiguration> shardingAlgorithms = new LinkedHashMap<>();
- private Map<String, KeyGenerateAlgorithmConfiguration> keyGenerators = new LinkedHashMap<>();
+ private Map<String, ShardingSphereAlgorithmConfiguration> keyGenerators = new LinkedHashMap<>();
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/algorithm/KeyGenerateAlgorithmConfiguration.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/algorithm/KeyGenerateAlgorithmConfiguration.java
deleted file mode 100644
index d920168..0000000
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/algorithm/KeyGenerateAlgorithmConfiguration.java
+++ /dev/null
@@ -1,32 +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.sharding.api.config.algorithm;
-
-import org.apache.shardingsphere.infra.config.TypedSPIConfiguration;
-
-import java.util.Properties;
-
-/**
- * Key generate algorithm configuration.
- */
-public final class KeyGenerateAlgorithmConfiguration extends TypedSPIConfiguration {
-
- public KeyGenerateAlgorithmConfiguration(final String type, final Properties props) {
- super(type, props);
- }
-}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/KeyGenerateAlgorithmConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/KeyGenerateAlgorithmConfigurationYamlSwapper.java
index 0069028..6df66a9 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/KeyGenerateAlgorithmConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/KeyGenerateAlgorithmConfigurationYamlSwapper.java
@@ -17,23 +17,23 @@
package org.apache.shardingsphere.sharding.yaml.swapper.algorithm;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.swapper.YamlSwapper;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm;
/**
* Key generate algorithm configuration YAML swapper.
*/
-public final class KeyGenerateAlgorithmConfigurationYamlSwapper implements YamlSwapper<YamlShardingSphereAlgorithmConfiguration, KeyGenerateAlgorithmConfiguration> {
+public final class KeyGenerateAlgorithmConfigurationYamlSwapper implements YamlSwapper<YamlShardingSphereAlgorithmConfiguration, ShardingSphereAlgorithmConfiguration> {
static {
ShardingSphereServiceLoader.register(KeyGenerateAlgorithm.class);
}
@Override
- public YamlShardingSphereAlgorithmConfiguration swap(final KeyGenerateAlgorithmConfiguration data) {
+ public YamlShardingSphereAlgorithmConfiguration swap(final ShardingSphereAlgorithmConfiguration data) {
YamlShardingSphereAlgorithmConfiguration result = new YamlShardingSphereAlgorithmConfiguration();
result.setType(data.getType());
result.setProps(data.getProps());
@@ -41,7 +41,7 @@ public final class KeyGenerateAlgorithmConfigurationYamlSwapper implements YamlS
}
@Override
- public KeyGenerateAlgorithmConfiguration swap(final YamlShardingSphereAlgorithmConfiguration yamlConfiguration) {
- return new KeyGenerateAlgorithmConfiguration(yamlConfiguration.getType(), yamlConfiguration.getProps());
+ public ShardingSphereAlgorithmConfiguration swap(final YamlShardingSphereAlgorithmConfiguration yamlConfiguration) {
+ return new ShardingSphereAlgorithmConfiguration(yamlConfiguration.getType(), yamlConfiguration.getProps());
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/ShardingAlgorithmConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/ShardingAlgorithmConfigurationYamlSwapper.java
index c87a70c..e4302da 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/ShardingAlgorithmConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/ShardingAlgorithmConfigurationYamlSwapper.java
@@ -17,23 +17,23 @@
package org.apache.shardingsphere.sharding.yaml.swapper.algorithm;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.swapper.YamlSwapper;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
/**
* Sharding algorithm configuration YAML swapper.
*/
-public final class ShardingAlgorithmConfigurationYamlSwapper implements YamlSwapper<YamlShardingSphereAlgorithmConfiguration, ShardingAlgorithmConfiguration> {
+public final class ShardingAlgorithmConfigurationYamlSwapper implements YamlSwapper<YamlShardingSphereAlgorithmConfiguration, ShardingSphereAlgorithmConfiguration> {
static {
ShardingSphereServiceLoader.register(ShardingAlgorithm.class);
}
@Override
- public YamlShardingSphereAlgorithmConfiguration swap(final ShardingAlgorithmConfiguration data) {
+ public YamlShardingSphereAlgorithmConfiguration swap(final ShardingSphereAlgorithmConfiguration data) {
YamlShardingSphereAlgorithmConfiguration result = new YamlShardingSphereAlgorithmConfiguration();
result.setType(data.getType());
result.setProps(data.getProps());
@@ -41,7 +41,7 @@ public final class ShardingAlgorithmConfigurationYamlSwapper implements YamlSwap
}
@Override
- public ShardingAlgorithmConfiguration swap(final YamlShardingSphereAlgorithmConfiguration yamlConfiguration) {
- return new ShardingAlgorithmConfiguration(yamlConfiguration.getType(), yamlConfiguration.getProps());
+ public ShardingSphereAlgorithmConfiguration swap(final YamlShardingSphereAlgorithmConfiguration yamlConfiguration) {
+ return new ShardingSphereAlgorithmConfiguration(yamlConfiguration.getType(), yamlConfiguration.getProps());
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
index 2a8e6b5..3d1889e 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/rule/ShardingRuleTest.java
@@ -17,11 +17,10 @@
package org.apache.shardingsphere.sharding.rule;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.config.exception.ShardingSphereConfigurationException;
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.keygen.KeyGenerateStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.NoneShardingStrategyConfiguration;
@@ -223,7 +222,7 @@ public final class ShardingRuleTest {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleConfigWithAllStrategies());
shardingRuleConfig.setDefaultDatabaseShardingStrategy(new StandardShardingStrategyConfiguration("column", "STANDARD_TEST"));
- shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingAlgorithmConfiguration("STANDARD_TEST", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST", new Properties()));
assertTrue(new ShardingRule(shardingRuleConfig, createDataSourceNames()).isShardingColumn("column", "LOGIC_TABLE"));
}
@@ -232,7 +231,7 @@ public final class ShardingRuleTest {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleConfigWithAllStrategies());
shardingRuleConfig.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("column", "STANDARD_TEST"));
- shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingAlgorithmConfiguration("STANDARD_TEST", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST", new Properties()));
assertTrue(new ShardingRule(shardingRuleConfig, createDataSourceNames()).isShardingColumn("column", "LOGIC_TABLE"));
}
@@ -240,7 +239,7 @@ public final class ShardingRuleTest {
public void assertIsShardingColumnForDatabaseShardingStrategy() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleConfigWithAllStrategies());
- shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingAlgorithmConfiguration("STANDARD_TEST", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST", new Properties()));
assertTrue(new ShardingRule(shardingRuleConfig, createDataSourceNames()).isShardingColumn("column", "logic_Table"));
}
@@ -248,7 +247,7 @@ public final class ShardingRuleTest {
public void assertIsShardingColumnForTableShardingStrategy() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleConfigWithTableStrategies());
- shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingAlgorithmConfiguration("STANDARD_TEST", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST", new Properties()));
assertTrue(new ShardingRule(shardingRuleConfig, createDataSourceNames()).isShardingColumn("column", "logic_Table"));
}
@@ -353,9 +352,9 @@ public final class ShardingRuleTest {
shardingAlgorithmTBL.setProps(props);
shardingRuleConfiguration.setDefaultTableShardingStrategy(new StandardShardingStrategyConfiguration("table_id", "standard"));
shardingRuleConfiguration.setDefaultKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("id", "default"));
- shardingRuleConfiguration.getShardingAlgorithms().put("standard", new ShardingAlgorithmConfiguration("STANDARD_TEST", new Properties()));
- shardingRuleConfiguration.getKeyGenerators().put("increment", new KeyGenerateAlgorithmConfiguration("INCREMENT", new Properties()));
- shardingRuleConfiguration.getKeyGenerators().put("default", new KeyGenerateAlgorithmConfiguration("INCREMENT", new Properties()));
+ shardingRuleConfiguration.getShardingAlgorithms().put("standard", new ShardingSphereAlgorithmConfiguration("STANDARD_TEST", new Properties()));
+ shardingRuleConfiguration.getKeyGenerators().put("increment", new ShardingSphereAlgorithmConfiguration("INCREMENT", new Properties()));
+ shardingRuleConfiguration.getKeyGenerators().put("default", new ShardingSphereAlgorithmConfiguration("INCREMENT", new Properties()));
return new ShardingRule(shardingRuleConfiguration, createDataSourceNames());
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/KeyGenerateAlgorithmConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/KeyGenerateAlgorithmConfigurationYamlSwapperTest.java
index 407dc9b..b7a86ed 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/KeyGenerateAlgorithmConfigurationYamlSwapperTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-common/src/test/java/org/apache/shardingsphere/sharding/yaml/swapper/algorithm/KeyGenerateAlgorithmConfigurationYamlSwapperTest.java
@@ -17,8 +17,8 @@
package org.apache.shardingsphere.sharding.yaml.swapper.algorithm;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.config.algorithm.YamlShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.KeyGenerateAlgorithmConfiguration;
import org.junit.Test;
import java.util.Properties;
@@ -30,7 +30,7 @@ public final class KeyGenerateAlgorithmConfigurationYamlSwapperTest {
@Test
public void assertSwapToYaml() {
- YamlShardingSphereAlgorithmConfiguration actual = new KeyGenerateAlgorithmConfigurationYamlSwapper().swap(new KeyGenerateAlgorithmConfiguration("UUID", new Properties()));
+ YamlShardingSphereAlgorithmConfiguration actual = new KeyGenerateAlgorithmConfigurationYamlSwapper().swap(new ShardingSphereAlgorithmConfiguration("UUID", new Properties()));
assertThat(actual.getType(), is("UUID"));
assertThat(actual.getProps(), is(new Properties()));
}
@@ -39,7 +39,7 @@ public final class KeyGenerateAlgorithmConfigurationYamlSwapperTest {
public void assertSwapToObject() {
YamlShardingSphereAlgorithmConfiguration yamlConfiguration = new YamlShardingSphereAlgorithmConfiguration();
yamlConfiguration.setType("UUID");
- KeyGenerateAlgorithmConfiguration actual = new KeyGenerateAlgorithmConfigurationYamlSwapper().swap(yamlConfiguration);
+ ShardingSphereAlgorithmConfiguration actual = new KeyGenerateAlgorithmConfigurationYamlSwapper().swap(yamlConfiguration);
assertThat(actual.getType(), is("UUID"));
assertThat(actual.getProps(), is(new Properties()));
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/fixture/AbstractRoutingEngineTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/fixture/AbstractRoutingEngineTest.java
index 90f69a8..d8e4845 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/fixture/AbstractRoutingEngineTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/fixture/AbstractRoutingEngineTest.java
@@ -17,8 +17,8 @@
package org.apache.shardingsphere.sharding.route.fixture;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
-import org.apache.shardingsphere.sharding.api.config.algorithm.ShardingAlgorithmConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.HintShardingStrategyConfiguration;
import org.apache.shardingsphere.sharding.api.config.strategy.sharding.ShardingStrategyConfiguration;
@@ -42,10 +42,10 @@ public abstract class AbstractRoutingEngineTest {
shardingRuleConfig.getTables().add(createInlineTableRuleConfig("t_order", "ds_${0..1}.t_order_${0..1}", "t_order_${order_id % 2}", "ds_${user_id % 2}"));
Properties props = new Properties();
props.setProperty("algorithm.expression", "ds_${user_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_order_${order_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("t_order_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("t_order_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
return new ShardingRule(shardingRuleConfig, Arrays.asList("ds_0", "ds_1"));
}
@@ -56,13 +56,13 @@ public abstract class AbstractRoutingEngineTest {
shardingRuleConfig.getBindingTableGroups().add("t_order,t_order_item");
Properties props = new Properties();
props.setProperty("algorithm.expression", "ds_${user_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_order_${order_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("t_order_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("t_order_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_order_item_${order_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("t_order_item_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("t_order_item_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
return new ShardingRule(shardingRuleConfig, Arrays.asList("ds_0", "ds_1"));
}
@@ -73,20 +73,20 @@ public abstract class AbstractRoutingEngineTest {
shardingRuleConfig.getBroadcastTables().add("t_config");
Properties props = new Properties();
props.setProperty("algorithm.expression", "ds_${user_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_order_${order_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("t_order_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("t_order_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_order_item_${order_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("t_order_item_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("t_order_item_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
return new ShardingRule(shardingRuleConfig, Arrays.asList("ds_0", "ds_1"));
}
protected final ShardingRule createHintShardingRule() {
ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
shardingRuleConfig.getTables().add(createTableRuleWithHintConfig());
- shardingRuleConfig.getShardingAlgorithms().put("hint_test", new ShardingAlgorithmConfiguration("HINT_TEST", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("hint_test", new ShardingSphereAlgorithmConfiguration("HINT_TEST", new Properties()));
return new ShardingRule(shardingRuleConfig, Arrays.asList("ds_0", "ds_1"));
}
@@ -96,13 +96,13 @@ public abstract class AbstractRoutingEngineTest {
new HintShardingStrategyConfiguration("hint_test"), createStandardShardingStrategyConfiguration("t_hint_ds_test_inline", "t_hint_ds_test_${order_id % 2}")));
shardingRuleConfig.getTables().add(createTableRuleConfig("t_hint_table_test", "ds_${0..1}.t_hint_table_test_${0..1}",
createStandardShardingStrategyConfiguration("ds_inline", "ds_${user_id % 2}"), new HintShardingStrategyConfiguration("hint_test")));
- shardingRuleConfig.getShardingAlgorithms().put("hint_test", new ShardingAlgorithmConfiguration("HINT_TEST", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("hint_test", new ShardingSphereAlgorithmConfiguration("HINT_TEST", new Properties()));
Properties props = new Properties();
props.setProperty("algorithm.expression", "ds_${user_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_hint_ds_test_${order_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("t_hint_ds_test_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("t_hint_ds_test_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
return new ShardingRule(shardingRuleConfig, Arrays.asList("ds_0", "ds_1"));
}
@@ -117,17 +117,17 @@ public abstract class AbstractRoutingEngineTest {
shardingRuleConfig.getTables().add(createInlineTableRuleConfig("t_user", "ds_${0..1}.t_user_${0..1}", "t_user_${user_id % 2}", "ds_${user_id % 2}"));
shardingRuleConfig.getTables().add(createTableRuleWithHintConfig());
shardingRuleConfig.getBindingTableGroups().add("t_order,t_order_item");
- shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("ds_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_order_${user_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("t_order_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("t_order_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_order_item_${user_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("t_order_item_inline", new ShardingAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("t_order_item_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
props = new Properties();
props.setProperty("algorithm.expression", "t_user_${user_id % 2}");
- shardingRuleConfig.getShardingAlgorithms().put("t_user_inline", new ShardingAlgorithmConfiguration("INLINE", props));
- shardingRuleConfig.getShardingAlgorithms().put("hint_test", new ShardingAlgorithmConfiguration("HINT_TEST", new Properties()));
+ shardingRuleConfig.getShardingAlgorithms().put("t_user_inline", new ShardingSphereAlgorithmConfiguration("INLINE", props));
+ shardingRuleConfig.getShardingAlgorithms().put("hint_test", new ShardingSphereAlgorithmConfiguration("HINT_TEST", new Properties()));
return new ShardingRule(shardingRuleConfig, Arrays.asList("ds_0", "ds_1", "main"));
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/algorithm/ShardingAlgorithmConfiguration.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmConfiguration.java
similarity index 77%
rename from shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/algorithm/ShardingAlgorithmConfiguration.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmConfiguration.java
index e7fdb13..0ac7094 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-api/src/main/java/org/apache/shardingsphere/sharding/api/config/algorithm/ShardingAlgorithmConfiguration.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/config/algorithm/ShardingSphereAlgorithmConfiguration.java
@@ -15,18 +15,18 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.sharding.api.config.algorithm;
+package org.apache.shardingsphere.infra.config.algorithm;
import org.apache.shardingsphere.infra.config.TypedSPIConfiguration;
import java.util.Properties;
/**
- * Sharding algorithm configuration.
+ * ShardingSphere algorithm configuration.
*/
-public final class ShardingAlgorithmConfiguration extends TypedSPIConfiguration {
+public final class ShardingSphereAlgorithmConfiguration extends TypedSPIConfiguration {
- public ShardingAlgorithmConfiguration(final String type, final Properties props) {
+ public ShardingSphereAlgorithmConfiguration(final String type, final Properties props) {
super(type, props);
}
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/test/java/org/apache/shardingsphere/driver/orchestration/internal/datasource/OrchestrationShardingSphereDataSourceTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/test/java/org/apache/shardingsphere/driver/orchestration/internal/datasource/OrchestrationShardingSphereDataSourceTest.java
index 30a4e9d..51ed490 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/test/java/org/apache/shardingsphere/driver/orchestration/internal/datasource/OrchestrationShardingSphereDataSourceTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/test/java/org/apache/shardingsphere/driver/orchestration/internal/datasource/OrchestrationShardingSphereDataSourceTest.java
@@ -22,9 +22,9 @@ import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
import org.apache.shardingsphere.infra.config.DataSourceConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.database.DefaultSchema;
import org.apache.shardingsphere.masterslave.api.config.MasterSlaveRuleConfiguration;
-import org.apache.shardingsphere.masterslave.api.config.algorithm.LoadBalanceAlgorithmConfiguration;
import org.apache.shardingsphere.masterslave.api.config.rule.MasterSlaveDataSourceRuleConfiguration;
import org.apache.shardingsphere.orchestration.center.config.CenterConfiguration;
import org.apache.shardingsphere.orchestration.center.config.OrchestrationConfiguration;
@@ -123,7 +123,8 @@ public final class OrchestrationShardingSphereDataSourceTest {
private MasterSlaveRuleConfiguration getMasterSlaveRuleConfiguration() {
MasterSlaveDataSourceRuleConfiguration dataSourceConfiguration = new MasterSlaveDataSourceRuleConfiguration("ds_ms", "ds_m", Collections.singletonList("ds_s"), "roundRobin");
- return new MasterSlaveRuleConfiguration(Collections.singleton(dataSourceConfiguration), ImmutableMap.of("roundRobin", new LoadBalanceAlgorithmConfiguration("ROUND_ROBIN", new Properties())));
+ return new MasterSlaveRuleConfiguration(
+ Collections.singleton(dataSourceConfiguration), ImmutableMap.of("roundRobin", new ShardingSphereAlgorithmConfiguration("ROUND_ROBIN", new Properties())));
}
@Test
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/orchestration/type/OrchestrationSpringBootEncryptTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/orchestration/type/Orchestratio [...]
index caf5bb6..991b470 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/orchestration/type/OrchestrationSpringBootEncryptTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/orchestration/type/OrchestrationSpringBootEncryptTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
import org.apache.shardingsphere.driver.orchestration.internal.datasource.OrchestrationShardingSphereDataSource;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.spring.boot.orchestration.util.EmbedTestingServer;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -68,8 +68,8 @@ public class OrchestrationSpringBootEncryptTest {
EncryptRuleConfiguration configuration =
(EncryptRuleConfiguration) shardingSphereDataSource.getSchemaContexts().getDefaultSchemaContext().getSchema().getConfigurations().iterator().next();
assertThat(configuration.getEncryptors().size(), is(1));
- EncryptAlgorithmConfiguration encryptAlgorithmConfiguration = configuration.getEncryptors().get("order_encrypt");
- assertThat(encryptAlgorithmConfiguration, instanceOf(EncryptAlgorithmConfiguration.class));
+ ShardingSphereAlgorithmConfiguration encryptAlgorithmConfiguration = configuration.getEncryptors().get("order_encrypt");
+ assertThat(encryptAlgorithmConfiguration, instanceOf(ShardingSphereAlgorithmConfiguration.class));
assertThat(encryptAlgorithmConfiguration.getType(), is("AES"));
assertThat(configuration.getTables().size(), is(1));
assertThat(configuration.getTables().iterator().next().getColumns().iterator().next().getCipherColumn(), is("cipher_order_id"));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/orchestration/type/OrchestrationSpringBootRegistryEncryptTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/orchestration/type/Orch [...]
index 7009ef7..2bf95e9 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/orchestration/type/OrchestrationSpringBootRegistryEncryptTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/orchestration/type/OrchestrationSpringBootRegistryEncryptTest.java
@@ -22,7 +22,7 @@ import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
import org.apache.shardingsphere.driver.orchestration.internal.datasource.OrchestrationShardingSphereDataSource;
import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.algorithm.EncryptAlgorithmConfiguration;
+import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.spring.boot.orchestration.registry.TestCenterRepository;
import org.apache.shardingsphere.spring.boot.orchestration.util.EmbedTestingServer;
import org.junit.BeforeClass;
@@ -81,8 +81,8 @@ public class OrchestrationSpringBootRegistryEncryptTest {
assertThat(embedDataSource.getUsername(), is("sa"));
EncryptRuleConfiguration configuration = (EncryptRuleConfiguration) encryptDataSource.getSchemaContexts().getDefaultSchemaContext().getSchema().getConfigurations().iterator().next();
assertThat(configuration.getEncryptors().size(), is(1));
- EncryptAlgorithmConfiguration encryptAlgorithmConfiguration = configuration.getEncryptors().get("order_encrypt");
- assertThat(encryptAlgorithmConfiguration, instanceOf(EncryptAlgorithmConfiguration.class));
+ ShardingSphereAlgorithmConfiguration encryptAlgorithmConfiguration = configuration.getEncryptors().get("order_encrypt");
+ assertThat(encryptAlgorithmConfiguration, instanceOf(ShardingSphereAlgorithmConfiguration.class));
assertThat(encryptAlgorithmConfiguration.getType(), is("AES"));
}