You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/08/04 08:20:58 UTC
[shardingsphere] branch master updated: Unify name conduct to YamlXXXSwapper for package yaml.config.swapper (#19865)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new e08b9ec5390 Unify name conduct to YamlXXXSwapper for package yaml.config.swapper (#19865)
e08b9ec5390 is described below
commit e08b9ec53903cc9b228af62a0bef9283354ba167
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu Aug 4 16:20:46 2022 +0800
Unify name conduct to YamlXXXSwapper for package yaml.config.swapper (#19865)
* Rename YamlAlgorithmConfigurationSwapper
* Rename YamlModeConfigurationSwapper
* Rename YamlModeConfigurationSwapper
* Rename YamlOnRuleAlteredActionConfigurationSwapper
* Unify name conduct to YamlXXXSwapper for package yaml.config.swapper
* Fix test cases
* Fix test cases
* Fix test cases
---
...abaseDiscoveryRuleConfigurationYamlSwapper.java | 4 +--
.../EncryptRuleConfigurationYamlSwapper.java | 12 +++----
...writeSplittingRuleConfigurationYamlSwapper.java | 4 +--
.../ShadowRuleConfigurationYamlSwapper.java | 4 +--
.../data/pipeline/ShardingRuleAlteredDetector.java | 12 +++----
.../ShardingRuleConfigurationYamlSwapper.java | 40 +++++++++++-----------
...rdingAutoTableRuleConfigurationYamlSwapper.java | 12 +++----
.../ShardingTableRuleConfigurationYamlSwapper.java | 22 ++++++------
.../ShardingRuleConfigurationYamlSwapperTest.java | 8 ++---
...gAutoTableRuleConfigurationYamlSwapperTest.java | 22 ++++++------
.../TableRuleConfigurationYamlSwapperTest.java | 4 +--
.../config/YamlUsersConfigurationConverter.java | 6 ++--
...java => YamlAlgorithmConfigurationSwapper.java} | 4 +--
...pper.java => YamlModeConfigurationSwapper.java} | 8 ++---
...YamlPersistRepositoryConfigurationSwapper.java} | 4 +--
...sistRepositoryConfigurationSwapperFactory.java} | 12 +++----
...mlOnRuleAlteredActionConfigurationSwapper.java} | 28 +++++++--------
... => YamlAlgorithmConfigurationSwapperTest.java} | 6 ++--
...sistRepositoryConfigurationSwapperFixture.java} | 4 +--
....java => YamlModeConfigurationSwapperTest.java} | 4 +--
...RepositoryConfigurationSwapperFactoryTest.java} | 6 ++--
...RuleAlteredActionConfigurationSwapperTest.java} | 10 +++---
...mode.YamlPersistRepositoryConfigurationSwapper} | 2 +-
.../yaml/YamlShardingSphereDataSourceFactory.java | 4 +--
.../boot/ShardingSphereAutoConfiguration.java | 4 +--
.../AuthorityRuleConfigurationYamlSwapper.java | 4 +--
.../core/api/impl/GovernanceRepositoryAPIImpl.java | 8 ++---
.../scenario/rulealtered/RuleAlteredContext.java | 4 +--
.../TrafficRuleConfigurationYamlSwapper.java | 4 +--
...YamlPersistRepositoryConfigurationSwapper.java} | 6 ++--
...mode.YamlPersistRepositoryConfigurationSwapper} | 2 +-
...YamlPersistRepositoryConfigurationSwapper.java} | 6 ++--
...mode.YamlPersistRepositoryConfigurationSwapper} | 2 +-
...PersistRepositoryConfigurationSwapperTest.java} | 8 ++---
.../proxy/initializer/BootstrapInitializer.java | 4 +--
.../api/impl/GovernanceRepositoryAPIImplTest.java | 4 +--
.../core/job/progress/JobProgressTest.java | 4 +--
.../progress/yaml/JobProgressYamlSwapperTest.java | 10 +++---
38 files changed, 156 insertions(+), 156 deletions(-)
diff --git a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/yaml/swapper/DatabaseDiscoveryRuleConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/yaml/swapper/DatabaseDiscoveryRuleConfigurationYamlSwapper.java
index 6a940b77f53..8a6bed700c1 100644
--- a/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/yaml/swapper/DatabaseDiscoveryRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-db-discovery/shardingsphere-db-discovery-core/src/main/java/org/apache/shardingsphere/dbdiscovery/yaml/swapper/DatabaseDiscoveryRuleConfigurationYamlSwapper.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.dbdiscovery.yaml.config.YamlDatabaseDiscoveryRu
import org.apache.shardingsphere.dbdiscovery.yaml.config.rule.YamlDatabaseDiscoveryHeartBeatConfiguration;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.AlgorithmConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.YamlAlgorithmConfigurationSwapper;
import org.apache.shardingsphere.dbdiscovery.api.config.DatabaseDiscoveryRuleConfiguration;
import java.util.Collection;
@@ -43,7 +43,7 @@ public final class DatabaseDiscoveryRuleConfigurationYamlSwapper
implements
YamlRuleConfigurationSwapper<YamlDatabaseDiscoveryRuleConfiguration, DatabaseDiscoveryRuleConfiguration> {
- private final AlgorithmConfigurationYamlSwapper algorithmSwapper = new AlgorithmConfigurationYamlSwapper();
+ private final YamlAlgorithmConfigurationSwapper algorithmSwapper = new YamlAlgorithmConfigurationSwapper();
@Override
public YamlDatabaseDiscoveryRuleConfiguration swapToYamlConfiguration(final DatabaseDiscoveryRuleConfiguration data) {
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapper.java
index 43ce434200d..a866185da98 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/EncryptRuleConfigurationYamlSwapper.java
@@ -27,8 +27,8 @@ import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.config.rule.rulealtered.OnRuleAlteredActionConfiguration;
import org.apache.shardingsphere.infra.yaml.config.pojo.algorithm.YamlAlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.AlgorithmConfigurationYamlSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.rule.rulealtered.OnRuleAlteredActionConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.YamlAlgorithmConfigurationSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.rule.rulealtered.YamlOnRuleAlteredActionConfigurationSwapper;
import java.util.Collection;
import java.util.LinkedHashMap;
@@ -43,9 +43,9 @@ public final class EncryptRuleConfigurationYamlSwapper implements YamlRuleConfig
private final EncryptTableRuleConfigurationYamlSwapper tableYamlSwapper = new EncryptTableRuleConfigurationYamlSwapper();
- private final AlgorithmConfigurationYamlSwapper algorithmSwapper = new AlgorithmConfigurationYamlSwapper();
+ private final YamlAlgorithmConfigurationSwapper algorithmSwapper = new YamlAlgorithmConfigurationSwapper();
- private final OnRuleAlteredActionConfigurationYamlSwapper onRuleAlteredActionYamlSwapper = new OnRuleAlteredActionConfigurationYamlSwapper();
+ private final YamlOnRuleAlteredActionConfigurationSwapper onRuleAlteredActionSwapper = new YamlOnRuleAlteredActionConfigurationSwapper();
@Override
public YamlEncryptRuleConfiguration swapToYamlConfiguration(final EncryptRuleConfiguration data) {
@@ -54,14 +54,14 @@ public final class EncryptRuleConfigurationYamlSwapper implements YamlRuleConfig
data.getEncryptors().forEach((key, value) -> result.getEncryptors().put(key, algorithmSwapper.swapToYamlConfiguration(value)));
result.setQueryWithCipherColumn(data.isQueryWithCipherColumn());
result.setDataConverterName(data.getDataConverterName());
- data.getDataConverters().forEach((key, value) -> result.getDataConverters().put(key, onRuleAlteredActionYamlSwapper.swapToYamlConfiguration(value)));
+ data.getDataConverters().forEach((key, value) -> result.getDataConverters().put(key, onRuleAlteredActionSwapper.swapToYamlConfiguration(value)));
return result;
}
@Override
public EncryptRuleConfiguration swapToObject(final YamlEncryptRuleConfiguration yamlConfig) {
Map<String, OnRuleAlteredActionConfiguration> dataConverters = new LinkedHashMap<>();
- yamlConfig.getDataConverters().forEach((key, value) -> dataConverters.put(key, onRuleAlteredActionYamlSwapper.swapToObject(value)));
+ yamlConfig.getDataConverters().forEach((key, value) -> dataConverters.put(key, onRuleAlteredActionSwapper.swapToObject(value)));
return new EncryptRuleConfiguration(swapTables(yamlConfig), swapEncryptAlgorithm(yamlConfig), yamlConfig.isQueryWithCipherColumn(),
yamlConfig.getDataConverterName(), dataConverters);
}
diff --git a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/swapper/ReadwriteSplittingRuleConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/swapper/ReadwriteSplittingRuleConfigurationYamlSwapper.java
index 59a85c01070..fb182d396f5 100644
--- a/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/swapper/ReadwriteSplittingRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/swapper/ReadwriteSplittingRuleConfigurationYamlSwapper.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.readwritesplitting.constant.ReadwriteSplittingO
import org.apache.shardingsphere.readwritesplitting.yaml.config.YamlReadwriteSplittingRuleConfiguration;
import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.AlgorithmConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.YamlAlgorithmConfigurationSwapper;
import org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
import org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceRuleConfiguration;
import org.apache.shardingsphere.readwritesplitting.yaml.config.rule.YamlReadwriteSplittingDataSourceRuleConfiguration;
@@ -46,7 +46,7 @@ public final class ReadwriteSplittingRuleConfigurationYamlSwapper
private final DynamicReadwriteSplittingStrategyConfigurationYamlSwapper dynamicReadwriteSplittingYamlSwapper = new DynamicReadwriteSplittingStrategyConfigurationYamlSwapper();
- private final AlgorithmConfigurationYamlSwapper algorithmSwapper = new AlgorithmConfigurationYamlSwapper();
+ private final YamlAlgorithmConfigurationSwapper algorithmSwapper = new YamlAlgorithmConfigurationSwapper();
@Override
public YamlReadwriteSplittingRuleConfiguration swapToYamlConfiguration(final ReadwriteSplittingRuleConfiguration data) {
diff --git a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleConfigurationYamlSwapper.java
index b6a334b7c51..bda395aaaee 100644
--- a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleConfigurationYamlSwapper.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.shadow.yaml.swapper;
import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.AlgorithmConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.YamlAlgorithmConfigurationSwapper;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import org.apache.shardingsphere.shadow.constant.ShadowOrder;
import org.apache.shardingsphere.shadow.yaml.config.YamlShadowRuleConfiguration;
@@ -34,7 +34,7 @@ public final class ShadowRuleConfigurationYamlSwapper implements YamlRuleConfigu
private final ShadowTableConfigurationYamlSwapper tableConfigurationYamlSwapper = new ShadowTableConfigurationYamlSwapper();
- private final AlgorithmConfigurationYamlSwapper algorithmSwapper = new AlgorithmConfigurationYamlSwapper();
+ private final YamlAlgorithmConfigurationSwapper algorithmSwapper = new YamlAlgorithmConfigurationSwapper();
@Override
public YamlShadowRuleConfiguration swapToYamlConfiguration(final ShadowRuleConfiguration data) {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/data/pipeline/ShardingRuleAlteredDetector.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/data/pipeline/ShardingRuleAlteredDetector.java
index f23230cf55e..ea8ede7fbc4 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/data/pipeline/ShardingRuleAlteredDetector.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/data/pipeline/ShardingRuleAlteredDetector.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.config.rule.rulealtered.OnRuleAlteredActi
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlRuleConfiguration;
import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlOnRuleAlteredActionConfiguration;
-import org.apache.shardingsphere.infra.yaml.config.swapper.rule.rulealtered.OnRuleAlteredActionConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.rule.rulealtered.YamlOnRuleAlteredActionConfigurationSwapper;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
@@ -47,9 +47,9 @@ import java.util.stream.Collectors;
*/
public final class ShardingRuleAlteredDetector implements RuleAlteredDetector {
- private static final ShardingRuleConfigurationYamlSwapper SHARDING_RULE_CONFIG_YAML_SWAPPER = new ShardingRuleConfigurationYamlSwapper();
+ private static final ShardingRuleConfigurationYamlSwapper SHARDING_RULE_CONFIG_SWAPPER = new ShardingRuleConfigurationYamlSwapper();
- private static final OnRuleAlteredActionConfigurationYamlSwapper RULE_ALTERED_ACTION_CONFIG_YAML_SWAPPER = new OnRuleAlteredActionConfigurationYamlSwapper();
+ private static final YamlOnRuleAlteredActionConfigurationSwapper RULE_ALTERED_ACTION_CONFIG_SWAPPER = new YamlOnRuleAlteredActionConfigurationSwapper();
@Override
public String getYamlRuleConfigClassName() {
@@ -74,8 +74,8 @@ public final class ShardingRuleAlteredDetector implements RuleAlteredDetector {
if (isShardingRulesTheSame((YamlShardingRuleConfiguration) sourceRuleConfig, (YamlShardingRuleConfiguration) targetRuleConfig)) {
return Collections.emptyList();
}
- ShardingRuleConfiguration sourceShardingConfig = SHARDING_RULE_CONFIG_YAML_SWAPPER.swapToObject((YamlShardingRuleConfiguration) sourceRuleConfig);
- ShardingRuleConfiguration targetShardingConfig = SHARDING_RULE_CONFIG_YAML_SWAPPER.swapToObject((YamlShardingRuleConfiguration) targetRuleConfig);
+ ShardingRuleConfiguration sourceShardingConfig = SHARDING_RULE_CONFIG_SWAPPER.swapToObject((YamlShardingRuleConfiguration) sourceRuleConfig);
+ ShardingRuleConfiguration targetShardingConfig = SHARDING_RULE_CONFIG_SWAPPER.swapToObject((YamlShardingRuleConfiguration) targetRuleConfig);
// TODO InstanceContext should not null
ShardingRule sourceShardingRule = new ShardingRule(sourceShardingConfig, sourceDataSources.keySet(), null);
ShardingRule targetShardingRule = new ShardingRule(targetShardingConfig, targetDataSources.keySet(), null);
@@ -156,7 +156,7 @@ public final class ShardingRuleAlteredDetector implements RuleAlteredDetector {
OnRuleAlteredActionConfiguration result = shardingRuleConfig.getScaling().get(scalingName);
if (null == result) {
YamlOnRuleAlteredActionConfiguration yamlConfig = new YamlOnRuleAlteredActionConfiguration();
- result = RULE_ALTERED_ACTION_CONFIG_YAML_SWAPPER.swapToObject(yamlConfig);
+ result = RULE_ALTERED_ACTION_CONFIG_SWAPPER.swapToObject(yamlConfig);
}
return Optional.of(result);
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/ShardingRuleConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/ShardingRuleConfigurationYamlSwapper.java
index 000faca9e48..3d97f6070af 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/ShardingRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/ShardingRuleConfigurationYamlSwapper.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sharding.yaml.swapper;
import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.AlgorithmConfigurationYamlSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.rule.rulealtered.OnRuleAlteredActionConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.YamlAlgorithmConfigurationSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.rule.rulealtered.YamlOnRuleAlteredActionConfigurationSwapper;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.constant.ShardingOrder;
import org.apache.shardingsphere.sharding.yaml.config.YamlShardingRuleConfiguration;
@@ -39,22 +39,22 @@ import java.util.Map.Entry;
*/
public final class ShardingRuleConfigurationYamlSwapper implements YamlRuleConfigurationSwapper<YamlShardingRuleConfiguration, ShardingRuleConfiguration> {
- private final ShardingTableRuleConfigurationYamlSwapper tableYamlSwapper = new ShardingTableRuleConfigurationYamlSwapper();
+ private final ShardingTableRuleConfigurationYamlSwapper tableSwapper = new ShardingTableRuleConfigurationYamlSwapper();
- private final ShardingStrategyConfigurationYamlSwapper shardingStrategyYamlSwapper = new ShardingStrategyConfigurationYamlSwapper();
+ private final ShardingStrategyConfigurationYamlSwapper shardingStrategySwapper = new ShardingStrategyConfigurationYamlSwapper();
- private final KeyGenerateStrategyConfigurationYamlSwapper keyGenerateStrategyYamlSwapper = new KeyGenerateStrategyConfigurationYamlSwapper();
+ private final KeyGenerateStrategyConfigurationYamlSwapper keyGenerateStrategySwapper = new KeyGenerateStrategyConfigurationYamlSwapper();
- private final AlgorithmConfigurationYamlSwapper algorithmSwapper = new AlgorithmConfigurationYamlSwapper();
+ private final YamlAlgorithmConfigurationSwapper algorithmSwapper = new YamlAlgorithmConfigurationSwapper();
- private final OnRuleAlteredActionConfigurationYamlSwapper onRuleAlteredActionYamlSwapper = new OnRuleAlteredActionConfigurationYamlSwapper();
+ private final YamlOnRuleAlteredActionConfigurationSwapper onRuleAlteredActionSwapper = new YamlOnRuleAlteredActionConfigurationSwapper();
- private final ShardingAuditStrategyConfigurationYamlSwapper auditStrategyYamlSwapper = new ShardingAuditStrategyConfigurationYamlSwapper();
+ private final ShardingAuditStrategyConfigurationYamlSwapper auditStrategySwapper = new ShardingAuditStrategyConfigurationYamlSwapper();
@Override
public YamlShardingRuleConfiguration swapToYamlConfiguration(final ShardingRuleConfiguration data) {
YamlShardingRuleConfiguration result = new YamlShardingRuleConfiguration();
- data.getTables().forEach(each -> result.getTables().put(each.getLogicTable(), tableYamlSwapper.swapToYamlConfiguration(each)));
+ data.getTables().forEach(each -> result.getTables().put(each.getLogicTable(), tableSwapper.swapToYamlConfiguration(each)));
data.getAutoTables().forEach(each -> result.getAutoTables().put(each.getLogicTable(),
new ShardingAutoTableRuleConfigurationYamlSwapper(Collections.emptyMap(), data.getShardingAlgorithms()).swapToYamlConfiguration(each)));
result.getBindingTables().addAll(data.getBindingTableGroups());
@@ -68,16 +68,16 @@ public final class ShardingRuleConfigurationYamlSwapper implements YamlRuleConfi
private void setYamlStrategies(final ShardingRuleConfiguration data, final YamlShardingRuleConfiguration yamlConfig) {
if (null != data.getDefaultDatabaseShardingStrategy()) {
- yamlConfig.setDefaultDatabaseStrategy(shardingStrategyYamlSwapper.swapToYamlConfiguration(data.getDefaultDatabaseShardingStrategy()));
+ yamlConfig.setDefaultDatabaseStrategy(shardingStrategySwapper.swapToYamlConfiguration(data.getDefaultDatabaseShardingStrategy()));
}
if (null != data.getDefaultTableShardingStrategy()) {
- yamlConfig.setDefaultTableStrategy(shardingStrategyYamlSwapper.swapToYamlConfiguration(data.getDefaultTableShardingStrategy()));
+ yamlConfig.setDefaultTableStrategy(shardingStrategySwapper.swapToYamlConfiguration(data.getDefaultTableShardingStrategy()));
}
if (null != data.getDefaultKeyGenerateStrategy()) {
- yamlConfig.setDefaultKeyGenerateStrategy(keyGenerateStrategyYamlSwapper.swapToYamlConfiguration(data.getDefaultKeyGenerateStrategy()));
+ yamlConfig.setDefaultKeyGenerateStrategy(keyGenerateStrategySwapper.swapToYamlConfiguration(data.getDefaultKeyGenerateStrategy()));
}
if (null != data.getDefaultAuditStrategy()) {
- yamlConfig.setDefaultAuditStrategy(auditStrategyYamlSwapper.swapToYamlConfiguration(data.getDefaultAuditStrategy()));
+ yamlConfig.setDefaultAuditStrategy(auditStrategySwapper.swapToYamlConfiguration(data.getDefaultAuditStrategy()));
}
}
@@ -92,7 +92,7 @@ public final class ShardingRuleConfigurationYamlSwapper implements YamlRuleConfi
data.getAuditors().forEach((key, value) -> yamlConfig.getAuditors().put(key, algorithmSwapper.swapToYamlConfiguration(value)));
}
if (null != data.getScaling()) {
- data.getScaling().forEach((key, value) -> yamlConfig.getScaling().put(key, onRuleAlteredActionYamlSwapper.swapToYamlConfiguration(value)));
+ data.getScaling().forEach((key, value) -> yamlConfig.getScaling().put(key, onRuleAlteredActionSwapper.swapToYamlConfiguration(value)));
}
}
@@ -102,7 +102,7 @@ public final class ShardingRuleConfigurationYamlSwapper implements YamlRuleConfi
for (Entry<String, YamlTableRuleConfiguration> entry : yamlConfig.getTables().entrySet()) {
YamlTableRuleConfiguration tableRuleConfig = entry.getValue();
tableRuleConfig.setLogicTable(entry.getKey());
- result.getTables().add(tableYamlSwapper.swapToObject(tableRuleConfig));
+ result.getTables().add(tableSwapper.swapToObject(tableRuleConfig));
}
for (Entry<String, YamlShardingAutoTableRuleConfiguration> entry : yamlConfig.getAutoTables().entrySet()) {
YamlShardingAutoTableRuleConfiguration tableRuleConfig = entry.getValue();
@@ -120,16 +120,16 @@ public final class ShardingRuleConfigurationYamlSwapper implements YamlRuleConfi
private void setStrategies(final YamlShardingRuleConfiguration yamlConfig, final ShardingRuleConfiguration ruleConfig) {
if (null != yamlConfig.getDefaultDatabaseStrategy()) {
- ruleConfig.setDefaultDatabaseShardingStrategy(shardingStrategyYamlSwapper.swapToObject(yamlConfig.getDefaultDatabaseStrategy()));
+ ruleConfig.setDefaultDatabaseShardingStrategy(shardingStrategySwapper.swapToObject(yamlConfig.getDefaultDatabaseStrategy()));
}
if (null != yamlConfig.getDefaultTableStrategy()) {
- ruleConfig.setDefaultTableShardingStrategy(shardingStrategyYamlSwapper.swapToObject(yamlConfig.getDefaultTableStrategy()));
+ ruleConfig.setDefaultTableShardingStrategy(shardingStrategySwapper.swapToObject(yamlConfig.getDefaultTableStrategy()));
}
if (null != yamlConfig.getDefaultKeyGenerateStrategy()) {
- ruleConfig.setDefaultKeyGenerateStrategy(keyGenerateStrategyYamlSwapper.swapToObject(yamlConfig.getDefaultKeyGenerateStrategy()));
+ ruleConfig.setDefaultKeyGenerateStrategy(keyGenerateStrategySwapper.swapToObject(yamlConfig.getDefaultKeyGenerateStrategy()));
}
if (null != yamlConfig.getDefaultAuditStrategy()) {
- ruleConfig.setDefaultAuditStrategy(auditStrategyYamlSwapper.swapToObject(yamlConfig.getDefaultAuditStrategy()));
+ ruleConfig.setDefaultAuditStrategy(auditStrategySwapper.swapToObject(yamlConfig.getDefaultAuditStrategy()));
}
}
@@ -144,7 +144,7 @@ public final class ShardingRuleConfigurationYamlSwapper implements YamlRuleConfi
yamlConfig.getAuditors().forEach((key, value) -> ruleConfig.getAuditors().put(key, algorithmSwapper.swapToObject(value)));
}
if (null != yamlConfig.getScaling()) {
- yamlConfig.getScaling().forEach((key, value) -> ruleConfig.getScaling().put(key, onRuleAlteredActionYamlSwapper.swapToObject(value)));
+ yamlConfig.getScaling().forEach((key, value) -> ruleConfig.getScaling().put(key, onRuleAlteredActionSwapper.swapToObject(value)));
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapper.java
index dec29ead550..c03800e869d 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapper.java
@@ -41,9 +41,9 @@ import java.util.Optional;
@RequiredArgsConstructor
public final class ShardingAutoTableRuleConfigurationYamlSwapper implements YamlConfigurationSwapper<YamlShardingAutoTableRuleConfiguration, ShardingAutoTableRuleConfiguration> {
- private final ShardingStrategyConfigurationYamlSwapper shardingStrategyYamlSwapper = new ShardingStrategyConfigurationYamlSwapper();
+ private final ShardingStrategyConfigurationYamlSwapper shardingStrategySwapper = new ShardingStrategyConfigurationYamlSwapper();
- private final KeyGenerateStrategyConfigurationYamlSwapper keyGenerateStrategyYamlSwapper = new KeyGenerateStrategyConfigurationYamlSwapper();
+ private final KeyGenerateStrategyConfigurationYamlSwapper keyGenerateStrategySwapper = new KeyGenerateStrategyConfigurationYamlSwapper();
// TODO remove after refactoring auto table actual data node.
private final Map<String, ShardingAlgorithm> shardingAlgorithms;
@@ -58,10 +58,10 @@ public final class ShardingAutoTableRuleConfigurationYamlSwapper implements Yaml
result.setActualDataSources(data.getActualDataSources());
result.setActualTablePrefix(data.getActualTablePrefix());
if (null != data.getShardingStrategy()) {
- result.setShardingStrategy(shardingStrategyYamlSwapper.swapToYamlConfiguration(data.getShardingStrategy()));
+ result.setShardingStrategy(shardingStrategySwapper.swapToYamlConfiguration(data.getShardingStrategy()));
}
if (null != data.getKeyGenerateStrategy()) {
- result.setKeyGenerateStrategy(keyGenerateStrategyYamlSwapper.swapToYamlConfiguration(data.getKeyGenerateStrategy()));
+ result.setKeyGenerateStrategy(keyGenerateStrategySwapper.swapToYamlConfiguration(data.getKeyGenerateStrategy()));
}
if (null != data.getActualDataNodes() && !data.getActualDataNodes().isEmpty()) {
result.setActualDataNodes(data.getActualDataNodes());
@@ -78,10 +78,10 @@ public final class ShardingAutoTableRuleConfigurationYamlSwapper implements Yaml
result.setActualTablePrefix(yamlConfig.getActualTablePrefix());
result.setActualDataNodes(yamlConfig.getActualDataNodes());
if (null != yamlConfig.getShardingStrategy()) {
- result.setShardingStrategy(shardingStrategyYamlSwapper.swapToObject(yamlConfig.getShardingStrategy()));
+ result.setShardingStrategy(shardingStrategySwapper.swapToObject(yamlConfig.getShardingStrategy()));
}
if (null != yamlConfig.getKeyGenerateStrategy()) {
- result.setKeyGenerateStrategy(keyGenerateStrategyYamlSwapper.swapToObject(yamlConfig.getKeyGenerateStrategy()));
+ result.setKeyGenerateStrategy(keyGenerateStrategySwapper.swapToObject(yamlConfig.getKeyGenerateStrategy()));
}
return result;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingTableRuleConfigurationYamlSwapper.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingTableRuleConfigurationYamlSwapper.java
index 1a22ca8a5ea..164656a76c7 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingTableRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/rule/ShardingTableRuleConfigurationYamlSwapper.java
@@ -30,11 +30,11 @@ import org.apache.shardingsphere.sharding.yaml.swapper.strategy.ShardingStrategy
*/
public final class ShardingTableRuleConfigurationYamlSwapper implements YamlConfigurationSwapper<YamlTableRuleConfiguration, ShardingTableRuleConfiguration> {
- private final ShardingStrategyConfigurationYamlSwapper shardingStrategyYamlSwapper = new ShardingStrategyConfigurationYamlSwapper();
+ private final ShardingStrategyConfigurationYamlSwapper shardingStrategySwapper = new ShardingStrategyConfigurationYamlSwapper();
- private final KeyGenerateStrategyConfigurationYamlSwapper keyGenerateStrategyYamlSwapper = new KeyGenerateStrategyConfigurationYamlSwapper();
+ private final KeyGenerateStrategyConfigurationYamlSwapper keyGenerateStrategySwapper = new KeyGenerateStrategyConfigurationYamlSwapper();
- private final ShardingAuditStrategyConfigurationYamlSwapper auditStrategyYamlSwapper = new ShardingAuditStrategyConfigurationYamlSwapper();
+ private final ShardingAuditStrategyConfigurationYamlSwapper auditStrategySwapper = new ShardingAuditStrategyConfigurationYamlSwapper();
@Override
public YamlTableRuleConfiguration swapToYamlConfiguration(final ShardingTableRuleConfiguration data) {
@@ -43,16 +43,16 @@ public final class ShardingTableRuleConfigurationYamlSwapper implements YamlConf
result.setActualDataNodes(data.getActualDataNodes());
result.setActualTablePrefix(data.getActualTablePrefix());
if (null != data.getDatabaseShardingStrategy()) {
- result.setDatabaseStrategy(shardingStrategyYamlSwapper.swapToYamlConfiguration(data.getDatabaseShardingStrategy()));
+ result.setDatabaseStrategy(shardingStrategySwapper.swapToYamlConfiguration(data.getDatabaseShardingStrategy()));
}
if (null != data.getTableShardingStrategy()) {
- result.setTableStrategy(shardingStrategyYamlSwapper.swapToYamlConfiguration(data.getTableShardingStrategy()));
+ result.setTableStrategy(shardingStrategySwapper.swapToYamlConfiguration(data.getTableShardingStrategy()));
}
if (null != data.getKeyGenerateStrategy()) {
- result.setKeyGenerateStrategy(keyGenerateStrategyYamlSwapper.swapToYamlConfiguration(data.getKeyGenerateStrategy()));
+ result.setKeyGenerateStrategy(keyGenerateStrategySwapper.swapToYamlConfiguration(data.getKeyGenerateStrategy()));
}
if (null != data.getAuditStrategy()) {
- result.setAuditStrategy(auditStrategyYamlSwapper.swapToYamlConfiguration(data.getAuditStrategy()));
+ result.setAuditStrategy(auditStrategySwapper.swapToYamlConfiguration(data.getAuditStrategy()));
}
return result;
}
@@ -63,16 +63,16 @@ public final class ShardingTableRuleConfigurationYamlSwapper implements YamlConf
ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration(yamlConfig.getLogicTable(), yamlConfig.getActualDataNodes());
result.setActualTablePrefix(yamlConfig.getActualTablePrefix());
if (null != yamlConfig.getDatabaseStrategy()) {
- result.setDatabaseShardingStrategy(shardingStrategyYamlSwapper.swapToObject(yamlConfig.getDatabaseStrategy()));
+ result.setDatabaseShardingStrategy(shardingStrategySwapper.swapToObject(yamlConfig.getDatabaseStrategy()));
}
if (null != yamlConfig.getTableStrategy()) {
- result.setTableShardingStrategy(shardingStrategyYamlSwapper.swapToObject(yamlConfig.getTableStrategy()));
+ result.setTableShardingStrategy(shardingStrategySwapper.swapToObject(yamlConfig.getTableStrategy()));
}
if (null != yamlConfig.getKeyGenerateStrategy()) {
- result.setKeyGenerateStrategy(keyGenerateStrategyYamlSwapper.swapToObject(yamlConfig.getKeyGenerateStrategy()));
+ result.setKeyGenerateStrategy(keyGenerateStrategySwapper.swapToObject(yamlConfig.getKeyGenerateStrategy()));
}
if (null != yamlConfig.getAuditStrategy()) {
- result.setAuditStrategy(auditStrategyYamlSwapper.swapToObject(yamlConfig.getAuditStrategy()));
+ result.setAuditStrategy(auditStrategySwapper.swapToObject(yamlConfig.getAuditStrategy()));
}
return result;
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/ShardingRuleConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/ShardingRuleConfigurationYamlSwapperTest.java
index 6b0c26b9744..531debce5eb 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/ShardingRuleConfigurationYamlSwapperTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/ShardingRuleConfigurationYamlSwapperTest.java
@@ -73,16 +73,16 @@ public final class ShardingRuleConfigurationYamlSwapperTest {
@Before
public void setUp() throws ReflectiveOperationException {
- setSwapper("tableYamlSwapper", tableRuleConfigurationYamlSwapper);
+ setSwapper("tableSwapper", tableRuleConfigurationYamlSwapper);
when(tableRuleConfigurationYamlSwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlTableRuleConfiguration.class));
when(tableRuleConfigurationYamlSwapper.swapToObject(ArgumentMatchers.any())).thenReturn(mock(ShardingTableRuleConfiguration.class));
- setSwapper("shardingStrategyYamlSwapper", shardingStrategyConfigurationYamlSwapper);
+ setSwapper("shardingStrategySwapper", shardingStrategyConfigurationYamlSwapper);
when(shardingStrategyConfigurationYamlSwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlShardingStrategyConfiguration.class));
when(shardingStrategyConfigurationYamlSwapper.swapToObject(ArgumentMatchers.any())).thenReturn(mock(ShardingStrategyConfiguration.class));
- setSwapper("keyGenerateStrategyYamlSwapper", keyGenerateStrategyConfigurationYamlSwapper);
+ setSwapper("keyGenerateStrategySwapper", keyGenerateStrategyConfigurationYamlSwapper);
when(keyGenerateStrategyConfigurationYamlSwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlKeyGenerateStrategyConfiguration.class));
when(keyGenerateStrategyConfigurationYamlSwapper.swapToObject(ArgumentMatchers.any())).thenReturn(mock(KeyGenerateStrategyConfiguration.class));
- setSwapper("auditStrategyYamlSwapper", shardingAuditStrategyConfigurationYamlSwapper);
+ setSwapper("auditStrategySwapper", shardingAuditStrategyConfigurationYamlSwapper);
when(shardingAuditStrategyConfigurationYamlSwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlShardingAuditStrategyConfiguration.class));
when(shardingAuditStrategyConfigurationYamlSwapper.swapToObject(ArgumentMatchers.any())).thenReturn(mock(ShardingAuditStrategyConfiguration.class));
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapperTest.java
index c091a34040c..dd9cabf5636 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapperTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/rule/ShardingAutoTableRuleConfigurationYamlSwapperTest.java
@@ -53,30 +53,30 @@ import static org.mockito.Mockito.withSettings;
public final class ShardingAutoTableRuleConfigurationYamlSwapperTest {
@Mock
- private ShardingStrategyConfigurationYamlSwapper shardingStrategyYamlSwapper;
+ private ShardingStrategyConfigurationYamlSwapper shardingStrategySwapper;
@Mock
- private KeyGenerateStrategyConfigurationYamlSwapper keyGenerateStrategyYamlSwapper;
+ private KeyGenerateStrategyConfigurationYamlSwapper keyGenerateStrategySwapper;
- private final ShardingAutoTableRuleConfigurationYamlSwapper tableYamlSwapper = new ShardingAutoTableRuleConfigurationYamlSwapper(mockAlgorithms(), Collections.emptyMap());
+ private final ShardingAutoTableRuleConfigurationYamlSwapper tableSwapper = new ShardingAutoTableRuleConfigurationYamlSwapper(mockAlgorithms(), Collections.emptyMap());
@Before
public void setUp() throws ReflectiveOperationException {
- setSwapper("shardingStrategyYamlSwapper", shardingStrategyYamlSwapper);
- when(shardingStrategyYamlSwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlShardingStrategyConfiguration.class));
- setSwapper("keyGenerateStrategyYamlSwapper", keyGenerateStrategyYamlSwapper);
- when(keyGenerateStrategyYamlSwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlKeyGenerateStrategyConfiguration.class));
+ setSwapper("shardingStrategySwapper", shardingStrategySwapper);
+ when(shardingStrategySwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlShardingStrategyConfiguration.class));
+ setSwapper("keyGenerateStrategySwapper", keyGenerateStrategySwapper);
+ when(keyGenerateStrategySwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlKeyGenerateStrategyConfiguration.class));
}
private void setSwapper(final String swapperFieldName, final YamlConfigurationSwapper swapperFieldValue) throws ReflectiveOperationException {
Field field = ShardingAutoTableRuleConfigurationYamlSwapper.class.getDeclaredField(swapperFieldName);
field.setAccessible(true);
- field.set(tableYamlSwapper, swapperFieldValue);
+ field.set(tableSwapper, swapperFieldValue);
}
@Test
public void assertSwapToYamlWithMinProperties() {
- YamlShardingAutoTableRuleConfiguration actual = tableYamlSwapper.swapToYamlConfiguration(new ShardingAutoTableRuleConfiguration("tbl", "ds0,ds1"));
+ YamlShardingAutoTableRuleConfiguration actual = tableSwapper.swapToYamlConfiguration(new ShardingAutoTableRuleConfiguration("tbl", "ds0,ds1"));
assertThat(actual.getLogicTable(), is("tbl"));
assertThat(actual.getActualDataSources(), is("ds0,ds1"));
assertNull(actual.getShardingStrategy());
@@ -90,7 +90,7 @@ public final class ShardingAutoTableRuleConfigurationYamlSwapperTest {
shardingTableRuleConfig.setShardingStrategy(mock(StandardShardingStrategyConfiguration.class));
shardingTableRuleConfig.setKeyGenerateStrategy(mock(KeyGenerateStrategyConfiguration.class));
shardingTableRuleConfig.setActualDataNodes("ds0.tbl_0");
- YamlShardingAutoTableRuleConfiguration actual = tableYamlSwapper.swapToYamlConfiguration(shardingTableRuleConfig);
+ YamlShardingAutoTableRuleConfiguration actual = tableSwapper.swapToYamlConfiguration(shardingTableRuleConfig);
assertThat(actual.getLogicTable(), is("tbl"));
assertThat(actual.getActualDataSources(), is("ds0,ds1"));
assertThat(actual.getActualTablePrefix(), is("tmp_"));
@@ -107,7 +107,7 @@ public final class ShardingAutoTableRuleConfigurationYamlSwapperTest {
when(strategyConfiguration.getShardingAlgorithmName()).thenReturn("mod_2");
shardingTableRuleConfig.setShardingStrategy(strategyConfiguration);
shardingTableRuleConfig.setKeyGenerateStrategy(mock(KeyGenerateStrategyConfiguration.class));
- YamlShardingAutoTableRuleConfiguration actual = tableYamlSwapper.swapToYamlConfiguration(shardingTableRuleConfig);
+ YamlShardingAutoTableRuleConfiguration actual = tableSwapper.swapToYamlConfiguration(shardingTableRuleConfig);
assertThat(actual.getLogicTable(), is("tbl"));
assertThat(actual.getActualDataSources(), is("ds0,ds1"));
assertThat(actual.getActualTablePrefix(), is("tmp_"));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/rule/TableRuleConfigurationYamlSwapperTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/rule/TableRuleConfigurationYamlSwapperTest.java
index 4491c61ee9b..046a1295439 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/rule/TableRuleConfigurationYamlSwapperTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/swapper/rule/TableRuleConfigurationYamlSwapperTest.java
@@ -59,10 +59,10 @@ public final class TableRuleConfigurationYamlSwapperTest {
@Before
public void setUp() throws ReflectiveOperationException {
- setSwapper("shardingStrategyYamlSwapper", shardingStrategyYamlSwapper);
+ setSwapper("shardingStrategySwapper", shardingStrategyYamlSwapper);
when(shardingStrategyYamlSwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlShardingStrategyConfiguration.class));
when(shardingStrategyYamlSwapper.swapToObject(ArgumentMatchers.any())).thenReturn(mock(ShardingStrategyConfiguration.class));
- setSwapper("keyGenerateStrategyYamlSwapper", keyGenerateStrategyYamlSwapper);
+ setSwapper("keyGenerateStrategySwapper", keyGenerateStrategyYamlSwapper);
when(keyGenerateStrategyYamlSwapper.swapToYamlConfiguration(ArgumentMatchers.any())).thenReturn(mock(YamlKeyGenerateStrategyConfiguration.class));
when(keyGenerateStrategyYamlSwapper.swapToObject(ArgumentMatchers.any())).thenReturn(mock(KeyGenerateStrategyConfiguration.class));
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/config/YamlUsersConfigurationConverter.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/config/YamlUsersConfigurationConverter.java
index c031308c157..89c8eef0ec3 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/config/YamlUsersConfigurationConverter.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/user/yaml/config/YamlUsersConfigurationConverter.java
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class YamlUsersConfigurationConverter {
- private static final UserYamlSwapper USER_YAML_SWAPPER = new UserYamlSwapper();
+ private static final UserYamlSwapper SWAPPER = new UserYamlSwapper();
/**
* Convert to users YAML content.
@@ -43,7 +43,7 @@ public final class YamlUsersConfigurationConverter {
*/
public static Collection<String> convertYamlUserConfigurations(final Collection<ShardingSphereUser> users) {
Collection<String> result = new LinkedList<>();
- users.stream().map(USER_YAML_SWAPPER::swapToYamlConfiguration).forEach(each -> result.add(each.toString()));
+ users.stream().map(SWAPPER::swapToYamlConfiguration).forEach(each -> result.add(each.toString()));
return result;
}
@@ -55,7 +55,7 @@ public final class YamlUsersConfigurationConverter {
*/
public static Collection<ShardingSphereUser> convertShardingSphereUser(final Collection<String> users) {
Collection<YamlUserConfiguration> yamlUsers = convertYamlUserConfiguration(users);
- return yamlUsers.stream().map(USER_YAML_SWAPPER::swapToObject).collect(Collectors.toList());
+ return yamlUsers.stream().map(SWAPPER::swapToObject).collect(Collectors.toList());
}
/**
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/AlgorithmConfigurationYamlSwapper.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/YamlAlgorithmConfigurationSwapper.java
similarity index 94%
rename from shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/AlgorithmConfigurationYamlSwapper.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/YamlAlgorithmConfigurationSwapper.java
index 9f8bcd26928..715bbf5c6e4 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/AlgorithmConfigurationYamlSwapper.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/YamlAlgorithmConfigurationSwapper.java
@@ -22,9 +22,9 @@ import org.apache.shardingsphere.infra.yaml.config.pojo.algorithm.YamlAlgorithmC
import org.apache.shardingsphere.infra.yaml.config.swapper.YamlConfigurationSwapper;
/**
- * Algorithm configuration YAML swapper.
+ * YAML algorithm configuration swapper.
*/
-public final class AlgorithmConfigurationYamlSwapper implements YamlConfigurationSwapper<YamlAlgorithmConfiguration, AlgorithmConfiguration> {
+public final class YamlAlgorithmConfigurationSwapper implements YamlConfigurationSwapper<YamlAlgorithmConfiguration, AlgorithmConfiguration> {
@Override
public YamlAlgorithmConfiguration swapToYamlConfiguration(final AlgorithmConfiguration data) {
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapper.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlModeConfigurationSwapper.java
similarity index 84%
rename from shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapper.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlModeConfigurationSwapper.java
index 7e5ab4eb263..a7bbd01ce28 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapper.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlModeConfigurationSwapper.java
@@ -23,16 +23,16 @@ import org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlModeConfigurati
import org.apache.shardingsphere.infra.yaml.config.swapper.YamlConfigurationSwapper;
/**
- * Mode rule configuration YAML swapper.
+ * YAML mode configuration swapper.
*/
-public final class ModeConfigurationYamlSwapper implements YamlConfigurationSwapper<YamlModeConfiguration, ModeConfiguration> {
+public final class YamlModeConfigurationSwapper implements YamlConfigurationSwapper<YamlModeConfiguration, ModeConfiguration> {
@Override
public YamlModeConfiguration swapToYamlConfiguration(final ModeConfiguration data) {
YamlModeConfiguration result = new YamlModeConfiguration();
result.setType(data.getType());
if (null != data.getRepository()) {
- PersistRepositoryConfigurationYamlSwapper<PersistRepositoryConfiguration> swapper = PersistRepositoryConfigurationYamlSwapperFactory.getInstance(data.getType());
+ YamlPersistRepositoryConfigurationSwapper<PersistRepositoryConfiguration> swapper = YamlPersistRepositoryConfigurationSwapperFactory.getInstance(data.getType());
result.setRepository(swapper.swapToYamlConfiguration(data.getRepository()));
}
result.setOverwrite(data.isOverwrite());
@@ -44,7 +44,7 @@ public final class ModeConfigurationYamlSwapper implements YamlConfigurationSwap
if (null == yamlConfig.getRepository()) {
return new ModeConfiguration(yamlConfig.getType(), null, yamlConfig.isOverwrite());
}
- PersistRepositoryConfigurationYamlSwapper<PersistRepositoryConfiguration> swapper = PersistRepositoryConfigurationYamlSwapperFactory.getInstance(yamlConfig.getType());
+ YamlPersistRepositoryConfigurationSwapper<PersistRepositoryConfiguration> swapper = YamlPersistRepositoryConfigurationSwapperFactory.getInstance(yamlConfig.getType());
return new ModeConfiguration(yamlConfig.getType(), swapper.swapToObject(yamlConfig.getRepository()), yamlConfig.isOverwrite());
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapper.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlPersistRepositoryConfigurationSwapper.java
similarity index 92%
rename from shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapper.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlPersistRepositoryConfigurationSwapper.java
index 978ceb2c816..1dd34d368f9 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapper.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlPersistRepositoryConfigurationSwapper.java
@@ -24,10 +24,10 @@ import org.apache.shardingsphere.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.spi.type.typed.TypedSPI;
/**
- * Persist repository configuration YAML swapper.
+ * YAML persist repository configuration swapper.
*
* @param <T> type of persist repository configuration
*/
@SingletonSPI
-public interface PersistRepositoryConfigurationYamlSwapper<T extends PersistRepositoryConfiguration> extends YamlConfigurationSwapper<YamlPersistRepositoryConfiguration, T>, TypedSPI {
+public interface YamlPersistRepositoryConfigurationSwapper<T extends PersistRepositoryConfiguration> extends YamlConfigurationSwapper<YamlPersistRepositoryConfiguration, T>, TypedSPI {
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactory.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlPersistRepositoryConfigurationSwapperFactory.java
similarity index 75%
rename from shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactory.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlPersistRepositoryConfigurationSwapperFactory.java
index 1555dd47f2f..8753f12ab13 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactory.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlPersistRepositoryConfigurationSwapperFactory.java
@@ -24,23 +24,23 @@ import org.apache.shardingsphere.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.spi.type.typed.TypedSPIRegistry;
/**
- * Persist repository configuration YAML swapper factory.
+ * YAML persist repository configuration swapper factory.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class PersistRepositoryConfigurationYamlSwapperFactory {
+public final class YamlPersistRepositoryConfigurationSwapperFactory {
static {
- ShardingSphereServiceLoader.register(PersistRepositoryConfigurationYamlSwapper.class);
+ ShardingSphereServiceLoader.register(YamlPersistRepositoryConfigurationSwapper.class);
}
/**
- * Get instance of persist repository configuration YAML swapper.
+ * Get instance of YAML persist repository configuration swapper.
*
* @param type swapper type
* @return got instance
*/
@SuppressWarnings("unchecked")
- public static PersistRepositoryConfigurationYamlSwapper<PersistRepositoryConfiguration> getInstance(final String type) {
- return TypedSPIRegistry.getRegisteredService(PersistRepositoryConfigurationYamlSwapper.class, type);
+ public static YamlPersistRepositoryConfigurationSwapper<PersistRepositoryConfiguration> getInstance(final String type) {
+ return TypedSPIRegistry.getRegisteredService(YamlPersistRepositoryConfigurationSwapper.class, type);
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/OnRuleAlteredActionConfigurationYamlSwapper.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/YamlOnRuleAlteredActionConfigurationSwapper.java
similarity index 77%
rename from shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/OnRuleAlteredActionConfigurationYamlSwapper.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/YamlOnRuleAlteredActionConfigurationSwapper.java
index 5d85f28b049..1702fb75672 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/OnRuleAlteredActionConfigurationYamlSwapper.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/YamlOnRuleAlteredActionConfigurationSwapper.java
@@ -24,14 +24,14 @@ import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlOnRuleAlteredAc
import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlOnRuleAlteredActionConfiguration.YamlInputConfiguration;
import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlOnRuleAlteredActionConfiguration.YamlOutputConfiguration;
import org.apache.shardingsphere.infra.yaml.config.swapper.YamlConfigurationSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.AlgorithmConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.YamlAlgorithmConfigurationSwapper;
/**
- * On rule altered action configuration YAML swapper.
+ * YAML on rule altered action configuration swapper.
*/
-public final class OnRuleAlteredActionConfigurationYamlSwapper implements YamlConfigurationSwapper<YamlOnRuleAlteredActionConfiguration, OnRuleAlteredActionConfiguration> {
+public final class YamlOnRuleAlteredActionConfigurationSwapper implements YamlConfigurationSwapper<YamlOnRuleAlteredActionConfiguration, OnRuleAlteredActionConfiguration> {
- private static final AlgorithmConfigurationYamlSwapper ALGORITHM_CONFIG_YAML_SWAPPER = new AlgorithmConfigurationYamlSwapper();
+ private static final YamlAlgorithmConfigurationSwapper ALGORITHM_CONFIG_SWAPPER = new YamlAlgorithmConfigurationSwapper();
private static final InputConfigurationSwapper INPUT_CONFIG_SWAPPER = new InputConfigurationSwapper();
@@ -45,9 +45,9 @@ public final class OnRuleAlteredActionConfigurationYamlSwapper implements YamlCo
YamlOnRuleAlteredActionConfiguration result = new YamlOnRuleAlteredActionConfiguration();
result.setInput(INPUT_CONFIG_SWAPPER.swapToYamlConfiguration(data.getInput()));
result.setOutput(OUTPUT_CONFIG_SWAPPER.swapToYamlConfiguration(data.getOutput()));
- result.setStreamChannel(ALGORITHM_CONFIG_YAML_SWAPPER.swapToYamlConfiguration(data.getStreamChannel()));
- result.setCompletionDetector(ALGORITHM_CONFIG_YAML_SWAPPER.swapToYamlConfiguration(data.getCompletionDetector()));
- result.setDataConsistencyChecker(ALGORITHM_CONFIG_YAML_SWAPPER.swapToYamlConfiguration(data.getDataConsistencyCalculator()));
+ result.setStreamChannel(ALGORITHM_CONFIG_SWAPPER.swapToYamlConfiguration(data.getStreamChannel()));
+ result.setCompletionDetector(ALGORITHM_CONFIG_SWAPPER.swapToYamlConfiguration(data.getCompletionDetector()));
+ result.setDataConsistencyChecker(ALGORITHM_CONFIG_SWAPPER.swapToYamlConfiguration(data.getDataConsistencyCalculator()));
return result;
}
@@ -59,9 +59,9 @@ public final class OnRuleAlteredActionConfigurationYamlSwapper implements YamlCo
return new OnRuleAlteredActionConfiguration(
INPUT_CONFIG_SWAPPER.swapToObject(yamlConfig.getInput()),
OUTPUT_CONFIG_SWAPPER.swapToObject(yamlConfig.getOutput()),
- ALGORITHM_CONFIG_YAML_SWAPPER.swapToObject(yamlConfig.getStreamChannel()),
- ALGORITHM_CONFIG_YAML_SWAPPER.swapToObject(yamlConfig.getCompletionDetector()),
- ALGORITHM_CONFIG_YAML_SWAPPER.swapToObject(yamlConfig.getDataConsistencyChecker()));
+ ALGORITHM_CONFIG_SWAPPER.swapToObject(yamlConfig.getStreamChannel()),
+ ALGORITHM_CONFIG_SWAPPER.swapToObject(yamlConfig.getCompletionDetector()),
+ ALGORITHM_CONFIG_SWAPPER.swapToObject(yamlConfig.getDataConsistencyChecker()));
}
public static class InputConfigurationSwapper implements YamlConfigurationSwapper<YamlInputConfiguration, InputConfiguration> {
@@ -75,7 +75,7 @@ public final class OnRuleAlteredActionConfigurationYamlSwapper implements YamlCo
result.setWorkerThread(data.getWorkerThread());
result.setBatchSize(data.getBatchSize());
result.setShardingSize(data.getShardingSize());
- result.setRateLimiter(ALGORITHM_CONFIG_YAML_SWAPPER.swapToYamlConfiguration(data.getRateLimiter()));
+ result.setRateLimiter(ALGORITHM_CONFIG_SWAPPER.swapToYamlConfiguration(data.getRateLimiter()));
return result;
}
@@ -84,7 +84,7 @@ public final class OnRuleAlteredActionConfigurationYamlSwapper implements YamlCo
return null == yamlConfig
? null
: new InputConfiguration(yamlConfig.getWorkerThread(), yamlConfig.getBatchSize(), yamlConfig.getShardingSize(),
- ALGORITHM_CONFIG_YAML_SWAPPER.swapToObject(yamlConfig.getRateLimiter()));
+ ALGORITHM_CONFIG_SWAPPER.swapToObject(yamlConfig.getRateLimiter()));
}
}
@@ -98,7 +98,7 @@ public final class OnRuleAlteredActionConfigurationYamlSwapper implements YamlCo
YamlOutputConfiguration result = new YamlOutputConfiguration();
result.setWorkerThread(data.getWorkerThread());
result.setBatchSize(data.getBatchSize());
- result.setRateLimiter(ALGORITHM_CONFIG_YAML_SWAPPER.swapToYamlConfiguration(data.getRateLimiter()));
+ result.setRateLimiter(ALGORITHM_CONFIG_SWAPPER.swapToYamlConfiguration(data.getRateLimiter()));
return result;
}
@@ -106,7 +106,7 @@ public final class OnRuleAlteredActionConfigurationYamlSwapper implements YamlCo
public OutputConfiguration swapToObject(final YamlOutputConfiguration yamlConfig) {
return null == yamlConfig
? null
- : new OutputConfiguration(yamlConfig.getWorkerThread(), yamlConfig.getBatchSize(), ALGORITHM_CONFIG_YAML_SWAPPER.swapToObject(yamlConfig.getRateLimiter()));
+ : new OutputConfiguration(yamlConfig.getWorkerThread(), yamlConfig.getBatchSize(), ALGORITHM_CONFIG_SWAPPER.swapToObject(yamlConfig.getRateLimiter()));
}
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/AlgorithmConfigurationYamlSwapperTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/YamlAlgorithmConfigurationSwapperTest.java
similarity index 87%
rename from shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/AlgorithmConfigurationYamlSwapperTest.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/YamlAlgorithmConfigurationSwapperTest.java
index 0e158636d33..7c8bbaf9c26 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/AlgorithmConfigurationYamlSwapperTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/algorithm/YamlAlgorithmConfigurationSwapperTest.java
@@ -26,11 +26,11 @@ import java.util.Properties;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-public final class AlgorithmConfigurationYamlSwapperTest {
+public final class YamlAlgorithmConfigurationSwapperTest {
@Test
public void assertSwapToYaml() {
- YamlAlgorithmConfiguration actual = new AlgorithmConfigurationYamlSwapper().swapToYamlConfiguration(
+ YamlAlgorithmConfiguration actual = new YamlAlgorithmConfigurationSwapper().swapToYamlConfiguration(
new AlgorithmConfiguration("TEST", createProps()));
assertThat(actual.getType(), is("TEST"));
assertThat(actual.getProps().getProperty("key"), is("value"));
@@ -39,7 +39,7 @@ public final class AlgorithmConfigurationYamlSwapperTest {
@Test
public void assertSwapToObject() {
YamlAlgorithmConfiguration yamlConfig = new YamlAlgorithmConfiguration("TEST", createProps());
- AlgorithmConfiguration actual = new AlgorithmConfigurationYamlSwapper().swapToObject(yamlConfig);
+ AlgorithmConfiguration actual = new YamlAlgorithmConfigurationSwapper().swapToObject(yamlConfig);
assertThat(actual.getType(), is("TEST"));
assertThat(actual.getProps().getProperty("key"), is("value"));
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationYamlSwapperFixture.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/YamlPersistRepositoryConfigurationSwapperFixture.java
similarity index 90%
rename from shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationYamlSwapperFixture.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/YamlPersistRepositoryConfigurationSwapperFixture.java
index 483dd723861..92894267e0e 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/PersistRepositoryConfigurationYamlSwapperFixture.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/fixture/YamlPersistRepositoryConfigurationSwapperFixture.java
@@ -18,9 +18,9 @@
package org.apache.shardingsphere.infra.yaml.config.swapper.fixture;
import org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfiguration;
-import org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper;
-public final class PersistRepositoryConfigurationYamlSwapperFixture implements PersistRepositoryConfigurationYamlSwapper<PersistRepositoryConfigurationFixture> {
+public final class YamlPersistRepositoryConfigurationSwapperFixture implements YamlPersistRepositoryConfigurationSwapper<PersistRepositoryConfigurationFixture> {
@Override
public YamlPersistRepositoryConfiguration swapToYamlConfiguration(final PersistRepositoryConfigurationFixture data) {
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapperTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlModeConfigurationSwapperTest.java
similarity index 92%
rename from shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapperTest.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlModeConfigurationSwapperTest.java
index 8aa14509b3e..5d265dec4fa 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/ModeConfigurationYamlSwapperTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlModeConfigurationSwapperTest.java
@@ -26,11 +26,11 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-public final class ModeConfigurationYamlSwapperTest {
+public final class YamlModeConfigurationSwapperTest {
private static final String TEST_TYPE = "TEST_TYPE";
- private final ModeConfigurationYamlSwapper swapper = new ModeConfigurationYamlSwapper();
+ private final YamlModeConfigurationSwapper swapper = new YamlModeConfigurationSwapper();
@Test
public void swapToYamlConfiguration() {
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactoryTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlPersistRepositoryConfigurationSwapperFactoryTest.java
similarity index 80%
rename from shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactoryTest.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlPersistRepositoryConfigurationSwapperFactoryTest.java
index 5358855c458..2b5cc67ac9e 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/PersistRepositoryConfigurationYamlSwapperFactoryTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/mode/YamlPersistRepositoryConfigurationSwapperFactoryTest.java
@@ -17,16 +17,16 @@
package org.apache.shardingsphere.infra.yaml.config.swapper.mode;
-import org.apache.shardingsphere.infra.yaml.config.swapper.fixture.PersistRepositoryConfigurationYamlSwapperFixture;
+import org.apache.shardingsphere.infra.yaml.config.swapper.fixture.YamlPersistRepositoryConfigurationSwapperFixture;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;
-public final class PersistRepositoryConfigurationYamlSwapperFactoryTest {
+public final class YamlPersistRepositoryConfigurationSwapperFactoryTest {
@Test
public void assertGetInstance() {
- assertThat(PersistRepositoryConfigurationYamlSwapperFactory.getInstance("Fixture"), instanceOf(PersistRepositoryConfigurationYamlSwapperFixture.class));
+ assertThat(YamlPersistRepositoryConfigurationSwapperFactory.getInstance("Fixture"), instanceOf(YamlPersistRepositoryConfigurationSwapperFixture.class));
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/OnRuleAlteredActionConfigurationYamlSwapperTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/YamlOnRuleAlteredActionConfigurationSwapperTest.java
similarity index 88%
rename from shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/OnRuleAlteredActionConfigurationYamlSwapperTest.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/YamlOnRuleAlteredActionConfigurationSwapperTest.java
index 2af8f2120c1..19abed84ed8 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/OnRuleAlteredActionConfigurationYamlSwapperTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/rulealtered/YamlOnRuleAlteredActionConfigurationSwapperTest.java
@@ -31,9 +31,9 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
-public final class OnRuleAlteredActionConfigurationYamlSwapperTest {
+public final class YamlOnRuleAlteredActionConfigurationSwapperTest {
- private static final OnRuleAlteredActionConfigurationYamlSwapper CONFIG_YAML_SWAPPER = new OnRuleAlteredActionConfigurationYamlSwapper();
+ private static final YamlOnRuleAlteredActionConfigurationSwapper SWAPPER = new YamlOnRuleAlteredActionConfigurationSwapper();
@Test
public void assertSwap() {
@@ -56,7 +56,7 @@ public final class OnRuleAlteredActionConfigurationYamlSwapperTest {
Properties dataConsistencyCheckerProps = new Properties();
dataConsistencyCheckerProps.setProperty("chunk-size", "1000");
yamlConfig.setDataConsistencyChecker(new YamlAlgorithmConfiguration("DATA_MATCH", dataConsistencyCheckerProps));
- OnRuleAlteredActionConfigurationYamlSwapper yamlSwapper = new OnRuleAlteredActionConfigurationYamlSwapper();
+ YamlOnRuleAlteredActionConfigurationSwapper yamlSwapper = new YamlOnRuleAlteredActionConfigurationSwapper();
OnRuleAlteredActionConfiguration actualConfig = yamlSwapper.swapToObject(yamlConfig);
YamlOnRuleAlteredActionConfiguration actualYamlConfig = yamlSwapper.swapToYamlConfiguration(actualConfig);
assertThat(YamlEngine.marshal(actualYamlConfig), is(YamlEngine.marshal(yamlConfig)));
@@ -64,11 +64,11 @@ public final class OnRuleAlteredActionConfigurationYamlSwapperTest {
@Test
public void assertYamlConfigNull() {
- assertNull(CONFIG_YAML_SWAPPER.swapToYamlConfiguration(null));
+ assertNull(SWAPPER.swapToYamlConfiguration(null));
}
@Test
public void assertConfigNull() {
- assertNull(CONFIG_YAML_SWAPPER.swapToObject(null));
+ assertNull(SWAPPER.swapToObject(null));
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper b/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper
similarity index 87%
rename from shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
rename to shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper
index dbfc0939256..f7a002e6e1b 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.infra.yaml.config.swapper.fixture.PersistRepositoryConfigurationYamlSwapperFixture
+org.apache.shardingsphere.infra.yaml.config.swapper.fixture.YamlPersistRepositoryConfigurationSwapperFixture
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactory.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactory.java
index ae0e9d72e58..af8f86f1a0e 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactory.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/api/yaml/YamlShardingSphereDataSourceFactory.java
@@ -27,7 +27,7 @@ import org.apache.shardingsphere.infra.database.DefaultDatabase;
import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRootConfiguration;
import org.apache.shardingsphere.infra.yaml.config.swapper.resource.YamlDataSourceConfigurationSwapper;
import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapperEngine;
-import org.apache.shardingsphere.infra.yaml.config.swapper.mode.ModeConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlModeConfigurationSwapper;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import javax.sql.DataSource;
@@ -128,7 +128,7 @@ public final class YamlShardingSphereDataSourceFactory {
}
private static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final YamlRootConfiguration rootConfig) throws SQLException {
- ModeConfiguration modeConfig = null == rootConfig.getMode() ? null : new ModeConfigurationYamlSwapper().swapToObject(rootConfig.getMode());
+ ModeConfiguration modeConfig = null == rootConfig.getMode() ? null : new YamlModeConfigurationSwapper().swapToObject(rootConfig.getMode());
Collection<RuleConfiguration> ruleConfigs = SWAPPER_ENGINE.swapToRuleConfigurations(rootConfig.getRules());
return ShardingSphereDataSourceFactory.createDataSource(rootConfig.getDatabaseName(), modeConfig, dataSourceMap, ruleConfigs, rootConfig.getProps());
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/main/java/org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/main/java/org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.java
index 7a6ae2a50d9..00d3a62e9ff 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/main/java/org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/main/java/org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.java
@@ -21,7 +21,7 @@ import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory;
import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
-import org.apache.shardingsphere.infra.yaml.config.swapper.mode.ModeConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlModeConfigurationSwapper;
import org.apache.shardingsphere.spring.boot.datasource.DataSourceMapSetter;
import org.apache.shardingsphere.spring.boot.prop.SpringBootPropertiesConfiguration;
import org.apache.shardingsphere.spring.boot.rule.LocalRulesCondition;
@@ -72,7 +72,7 @@ public class ShardingSphereAutoConfiguration implements EnvironmentAware {
*/
@Bean
public ModeConfiguration modeConfiguration() {
- return null == props.getMode() ? null : new ModeConfigurationYamlSwapper().swapToObject(props.getMode());
+ return null == props.getMode() ? null : new YamlModeConfigurationSwapper().swapToObject(props.getMode());
}
/**
diff --git a/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/yaml/swapper/AuthorityRuleConfigurationYamlSwapper.java b/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/yaml/swapper/AuthorityRuleConfigurationYamlSwapper.java
index 4d9ef3fbc8d..560e294ef22 100644
--- a/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/yaml/swapper/AuthorityRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/main/java/org/apache/shardingsphere/authority/yaml/swapper/AuthorityRuleConfigurationYamlSwapper.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.infra.config.algorithm.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
import org.apache.shardingsphere.infra.metadata.user.yaml.config.YamlUsersConfigurationConverter;
import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.AlgorithmConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.YamlAlgorithmConfigurationSwapper;
import java.util.Collection;
@@ -34,7 +34,7 @@ import java.util.Collection;
*/
public final class AuthorityRuleConfigurationYamlSwapper implements YamlRuleConfigurationSwapper<YamlAuthorityRuleConfiguration, AuthorityRuleConfiguration> {
- private final AlgorithmConfigurationYamlSwapper algorithmSwapper = new AlgorithmConfigurationYamlSwapper();
+ private final YamlAlgorithmConfigurationSwapper algorithmSwapper = new YamlAlgorithmConfigurationSwapper();
@Override
public YamlAuthorityRuleConfiguration swapToYamlConfiguration(final AuthorityRuleConfiguration data) {
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/GovernanceRepositoryAPIImpl.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/GovernanceRepositoryAPIImpl.java
index 535b266965f..e539103bd10 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/GovernanceRepositoryAPIImpl.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/core/api/impl/GovernanceRepositoryAPIImpl.java
@@ -48,7 +48,7 @@ import java.util.stream.Collectors;
@Slf4j
public final class GovernanceRepositoryAPIImpl implements GovernanceRepositoryAPI {
- private static final JobProgressYamlSwapper JOB_PROGRESS_YAML_SWAPPER = new JobProgressYamlSwapper();
+ private static final JobProgressYamlSwapper SWAPPER = new JobProgressYamlSwapper();
private final ClusterPersistRepository repository;
@@ -64,7 +64,7 @@ public final class GovernanceRepositoryAPIImpl implements GovernanceRepositoryAP
jobProgress.setSourceDatabaseType(jobContext.getJobConfig().getSourceDatabaseType());
jobProgress.setIncrementalTaskProgressMap(getIncrementalTaskProgressMap(jobContext));
jobProgress.setInventoryTaskProgressMap(getInventoryTaskProgressMap(jobContext));
- String value = YamlEngine.marshal(JOB_PROGRESS_YAML_SWAPPER.swapToYaml(jobProgress));
+ String value = YamlEngine.marshal(SWAPPER.swapToYaml(jobProgress));
repository.persist(PipelineMetaDataNode.getScalingJobOffsetPath(jobContext.getJobId(), jobContext.getShardingItem()), value);
}
@@ -90,7 +90,7 @@ public final class GovernanceRepositoryAPIImpl implements GovernanceRepositoryAP
if (Strings.isNullOrEmpty(data)) {
return null;
}
- return JOB_PROGRESS_YAML_SWAPPER.swapToObject(YamlEngine.unmarshal(data, YamlJobProgress.class));
+ return SWAPPER.swapToObject(YamlEngine.unmarshal(data, YamlJobProgress.class));
}
@Override
@@ -141,6 +141,6 @@ public final class GovernanceRepositoryAPIImpl implements GovernanceRepositoryAP
return;
}
jobProgress.setStatus(status);
- persist(PipelineMetaDataNode.getScalingJobOffsetPath(jobId, shardingItem), YamlEngine.marshal(JOB_PROGRESS_YAML_SWAPPER.swapToYaml(jobProgress)));
+ persist(PipelineMetaDataNode.getScalingJobOffsetPath(jobId, shardingItem), YamlEngine.marshal(SWAPPER.swapToYaml(jobProgress)));
}
}
diff --git a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/RuleAlteredContext.java b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/RuleAlteredContext.java
index f06d0ca684a..6f2ed908b5f 100644
--- a/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/RuleAlteredContext.java
+++ b/shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-core/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/rulealtered/RuleAlteredContext.java
@@ -38,7 +38,7 @@ import org.apache.shardingsphere.infra.yaml.config.pojo.algorithm.YamlAlgorithmC
import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlOnRuleAlteredActionConfiguration;
import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlOnRuleAlteredActionConfiguration.YamlInputConfiguration;
import org.apache.shardingsphere.infra.yaml.config.pojo.rule.YamlOnRuleAlteredActionConfiguration.YamlOutputConfiguration;
-import org.apache.shardingsphere.infra.yaml.config.swapper.rule.rulealtered.OnRuleAlteredActionConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.rule.rulealtered.YamlOnRuleAlteredActionConfigurationSwapper;
import java.util.Properties;
@@ -56,7 +56,7 @@ public final class RuleAlteredContext {
private static final String IMPORTER_THREAD_PREFIX = "Importer-";
- private static final OnRuleAlteredActionConfigurationYamlSwapper SWAPPER = new OnRuleAlteredActionConfigurationYamlSwapper();
+ private static final YamlOnRuleAlteredActionConfigurationSwapper SWAPPER = new YamlOnRuleAlteredActionConfigurationSwapper();
private final OnRuleAlteredActionConfiguration onRuleAlteredActionConfig;
diff --git a/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/main/java/org/apache/shardingsphere/traffic/yaml/swapper/TrafficRuleConfigurationYamlSwapper.java b/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/main/java/org/apache/shardingsphere/traffic/yaml/swapper/TrafficRuleConfigurationYamlSwapper.java
index 75cf21b6f87..a24a1278145 100644
--- a/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/main/java/org/apache/shardingsphere/traffic/yaml/swapper/TrafficRuleConfigurationYamlSwapper.java
+++ b/shardingsphere-kernel/shardingsphere-traffic/shardingsphere-traffic-core/src/main/java/org/apache/shardingsphere/traffic/yaml/swapper/TrafficRuleConfigurationYamlSwapper.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.traffic.yaml.swapper;
import org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlRuleConfigurationSwapper;
-import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.AlgorithmConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.algorithm.YamlAlgorithmConfigurationSwapper;
import org.apache.shardingsphere.traffic.api.config.TrafficRuleConfiguration;
import org.apache.shardingsphere.traffic.constant.TrafficOrder;
import org.apache.shardingsphere.traffic.yaml.config.YamlTrafficRuleConfiguration;
@@ -33,7 +33,7 @@ public final class TrafficRuleConfigurationYamlSwapper implements YamlRuleConfig
private final TrafficStrategyConfigurationYamlSwapper strategySwapper = new TrafficStrategyConfigurationYamlSwapper();
- private final AlgorithmConfigurationYamlSwapper algorithmSwapper = new AlgorithmConfigurationYamlSwapper();
+ private final YamlAlgorithmConfigurationSwapper algorithmSwapper = new YamlAlgorithmConfigurationSwapper();
@Override
public YamlTrafficRuleConfiguration swapToYamlConfiguration(final TrafficRuleConfiguration data) {
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/yaml/ClusterPersistRepositoryConfigurationYamlSwapper.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/yaml/ClusterYamlPersistRepositoryConfigurationSwapper.java
similarity index 90%
rename from shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/yaml/ClusterPersistRepositoryConfigurationYamlSwapper.java
rename to shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/yaml/ClusterYamlPersistRepositoryConfigurationSwapper.java
index 03d6ed4c267..287751e93f4 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/yaml/ClusterPersistRepositoryConfigurationYamlSwapper.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/yaml/ClusterYamlPersistRepositoryConfigurationSwapper.java
@@ -19,12 +19,12 @@ package org.apache.shardingsphere.mode.manager.cluster.yaml;
import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepositoryConfiguration;
import org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfiguration;
-import org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper;
/**
- * Cluster persist repository configuration YAML swapper.
+ * Cluster YAML persist repository configuration swapper.
*/
-public final class ClusterPersistRepositoryConfigurationYamlSwapper implements PersistRepositoryConfigurationYamlSwapper<ClusterPersistRepositoryConfiguration> {
+public final class ClusterYamlPersistRepositoryConfigurationSwapper implements YamlPersistRepositoryConfigurationSwapper<ClusterPersistRepositoryConfiguration> {
@Override
public YamlPersistRepositoryConfiguration swapToYamlConfiguration(final ClusterPersistRepositoryConfiguration data) {
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper
similarity index 88%
rename from shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
rename to shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper
index 757a2450215..c99b74c9e28 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.mode.manager.cluster.yaml.ClusterPersistRepositoryConfigurationYamlSwapper
+org.apache.shardingsphere.mode.manager.cluster.yaml.ClusterYamlPersistRepositoryConfigurationSwapper
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/yaml/StandalonePersistRepositoryConfigurationYamlSwapper.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/yaml/StandaloneYamlPersistRepositoryConfigurationSwapper.java
similarity index 88%
rename from shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/yaml/StandalonePersistRepositoryConfigurationYamlSwapper.java
rename to shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/yaml/StandaloneYamlPersistRepositoryConfigurationSwapper.java
index 88d2bd6766f..333044900c7 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/yaml/StandalonePersistRepositoryConfigurationYamlSwapper.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/standalone/yaml/StandaloneYamlPersistRepositoryConfigurationSwapper.java
@@ -19,12 +19,12 @@ package org.apache.shardingsphere.mode.manager.standalone.yaml;
import org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepositoryConfiguration;
import org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfiguration;
-import org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper;
/**
- * Standalone persist repository configuration YAML swapper.
+ * Standalone YAML persist repository configuration swapper.
*/
-public final class StandalonePersistRepositoryConfigurationYamlSwapper implements PersistRepositoryConfigurationYamlSwapper<StandalonePersistRepositoryConfiguration> {
+public final class StandaloneYamlPersistRepositoryConfigurationSwapper implements YamlPersistRepositoryConfigurationSwapper<StandalonePersistRepositoryConfiguration> {
@Override
public YamlPersistRepositoryConfiguration swapToYamlConfiguration(final StandalonePersistRepositoryConfiguration data) {
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryCon [...]
similarity index 95%
rename from shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
rename to shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper
index 4422da85488..a88aa27daa7 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.PersistRepositoryConfigurationYamlSwapper
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlPersistRepositoryConfigurationSwapper
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.mode.manager.standalone.yaml.StandalonePersistRepositoryConfigurationYamlSwapper
+org.apache.shardingsphere.mode.manager.standalone.yaml.StandaloneYamlPersistRepositoryConfigurationSwapper
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryConfigurationYamlSwapperTest.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneYamlPersistRepositoryConfigurationSwapperTest.java
similarity index 90%
rename from shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryConfigurationYamlSwapperTest.java
rename to shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneYamlPersistRepositoryConfigurationSwapperTest.java
index 6124cf1bfe0..950fcedb86e 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandalonePersistRepositoryConfigurationYamlSwapperTest.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-core/src/test/java/org/apache/shardingsphere/mode/manager/standalone/StandaloneYamlPersistRepositoryConfigurationSwapperTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.mode.manager.standalone;
import org.apache.shardingsphere.infra.yaml.config.pojo.mode.YamlPersistRepositoryConfiguration;
-import org.apache.shardingsphere.mode.manager.standalone.yaml.StandalonePersistRepositoryConfigurationYamlSwapper;
+import org.apache.shardingsphere.mode.manager.standalone.yaml.StandaloneYamlPersistRepositoryConfigurationSwapper;
import org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepositoryConfiguration;
import org.junit.Test;
@@ -27,14 +27,14 @@ import java.util.Properties;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-public final class StandalonePersistRepositoryConfigurationYamlSwapperTest {
+public final class StandaloneYamlPersistRepositoryConfigurationSwapperTest {
public static final String TEST_TYPE = "TEST_TYPE";
@Test
public void assertSwapToYamlConfiguration() {
StandalonePersistRepositoryConfiguration standalonePersistRepositoryConfig = new StandalonePersistRepositoryConfiguration(TEST_TYPE, new Properties());
- YamlPersistRepositoryConfiguration actual = new StandalonePersistRepositoryConfigurationYamlSwapper().swapToYamlConfiguration(standalonePersistRepositoryConfig);
+ YamlPersistRepositoryConfiguration actual = new StandaloneYamlPersistRepositoryConfigurationSwapper().swapToYamlConfiguration(standalonePersistRepositoryConfig);
assertThat(actual.getProps(), is(new Properties()));
assertThat(actual.getType(), is(TEST_TYPE));
}
@@ -43,7 +43,7 @@ public final class StandalonePersistRepositoryConfigurationYamlSwapperTest {
public void assertSwapToObject() {
YamlPersistRepositoryConfiguration yamlPersistRepositoryConfig = new YamlPersistRepositoryConfiguration();
yamlPersistRepositoryConfig.setType(TEST_TYPE);
- StandalonePersistRepositoryConfiguration actual = new StandalonePersistRepositoryConfigurationYamlSwapper().swapToObject(yamlPersistRepositoryConfig);
+ StandalonePersistRepositoryConfiguration actual = new StandaloneYamlPersistRepositoryConfigurationSwapper().swapToObject(yamlPersistRepositoryConfig);
assertThat(actual.getProps(), is(new Properties()));
assertThat(actual.getType(), is(TEST_TYPE));
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/initializer/BootstrapInitializer.java b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/initializer/BootstrapInitializer.java
index dda3d0e5fad..b17aae1cd97 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/initializer/BootstrapInitializer.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/initializer/BootstrapInitializer.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.config.mode.ModeConfiguration;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaData;
import org.apache.shardingsphere.infra.instance.metadata.InstanceMetaDataBuilderFactory;
-import org.apache.shardingsphere.infra.yaml.config.swapper.mode.ModeConfigurationYamlSwapper;
+import org.apache.shardingsphere.infra.yaml.config.swapper.mode.YamlModeConfigurationSwapper;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.mode.manager.ContextManagerBuilderFactory;
import org.apache.shardingsphere.mode.manager.ContextManagerBuilderParameter;
@@ -52,7 +52,7 @@ public final class BootstrapInitializer {
* @throws SQLException SQL exception
*/
public void init(final YamlProxyConfiguration yamlConfig, final int port) throws SQLException {
- ModeConfiguration modeConfig = null == yamlConfig.getServerConfiguration().getMode() ? null : new ModeConfigurationYamlSwapper().swapToObject(yamlConfig.getServerConfiguration().getMode());
+ ModeConfiguration modeConfig = null == yamlConfig.getServerConfiguration().getMode() ? null : new YamlModeConfigurationSwapper().swapToObject(yamlConfig.getServerConfiguration().getMode());
ProxyConfiguration proxyConfig = new YamlProxyConfigurationSwapper().swap(yamlConfig);
ContextManager contextManager = createContextManager(proxyConfig, modeConfig, port);
ProxyContext.init(contextManager);
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/api/impl/GovernanceRepositoryAPIImplTest.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/api/impl/GovernanceRepositoryAPIImplTest.java
index a4c3af36197..a0d04baf729 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/api/impl/GovernanceRepositoryAPIImplTest.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/api/impl/GovernanceRepositoryAPIImplTest.java
@@ -62,7 +62,7 @@ import static org.mockito.Mockito.mock;
public final class GovernanceRepositoryAPIImplTest {
- private static final JobProgressYamlSwapper JOB_PROGRESS_YAML_SWAPPER = new JobProgressYamlSwapper();
+ private static final JobProgressYamlSwapper SWAPPER = new JobProgressYamlSwapper();
private static GovernanceRepositoryAPI governanceRepositoryAPI;
@@ -77,7 +77,7 @@ public final class GovernanceRepositoryAPIImplTest {
RuleAlteredJobContext jobContext = mockJobContext();
governanceRepositoryAPI.persistJobProgress(jobContext);
JobProgress actual = governanceRepositoryAPI.getJobProgress(jobContext.getJobId(), jobContext.getShardingItem());
- assertThat(YamlEngine.marshal(JOB_PROGRESS_YAML_SWAPPER.swapToYaml(actual)), is(ConfigurationFileUtil.readFileAndIgnoreComments("governance-repository.yaml")));
+ assertThat(YamlEngine.marshal(SWAPPER.swapToYaml(actual)), is(ConfigurationFileUtil.readFileAndIgnoreComments("governance-repository.yaml")));
}
@Test
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/JobProgressTest.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/JobProgressTest.java
index b6a078cf631..c6159cd7b39 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/JobProgressTest.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/JobProgressTest.java
@@ -38,7 +38,7 @@ import static org.junit.Assert.assertTrue;
public final class JobProgressTest {
- private static final JobProgressYamlSwapper JOB_PROGRESS_YAML_SWAPPER = new JobProgressYamlSwapper();
+ private static final JobProgressYamlSwapper SWAPPER = new JobProgressYamlSwapper();
@Test
public void assertInit() {
@@ -98,6 +98,6 @@ public final class JobProgressTest {
}
private JobProgress getJobProgress(final String data) {
- return JOB_PROGRESS_YAML_SWAPPER.swapToObject(YamlEngine.unmarshal(data, YamlJobProgress.class));
+ return SWAPPER.swapToObject(YamlEngine.unmarshal(data, YamlJobProgress.class));
}
}
diff --git a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/yaml/JobProgressYamlSwapperTest.java b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/yaml/JobProgressYamlSwapperTest.java
index a1b777266ab..38a93a5323f 100644
--- a/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/yaml/JobProgressYamlSwapperTest.java
+++ b/shardingsphere-test/shardingsphere-pipeline-test/src/test/java/org/apache/shardingsphere/data/pipeline/core/job/progress/yaml/JobProgressYamlSwapperTest.java
@@ -31,16 +31,16 @@ import static org.junit.Assert.assertNull;
public final class JobProgressYamlSwapperTest {
- private static final JobProgressYamlSwapper JOB_PROGRESS_YAML_SWAPPER = new JobProgressYamlSwapper();
+ private static final JobProgressYamlSwapper SWAPPER = new JobProgressYamlSwapper();
private JobProgress getJobProgress(final String data) {
- return JOB_PROGRESS_YAML_SWAPPER.swapToObject(YamlEngine.unmarshal(data, YamlJobProgress.class));
+ return SWAPPER.swapToObject(YamlEngine.unmarshal(data, YamlJobProgress.class));
}
@Test
public void assertFullSwapToYaml() {
JobProgress jobProgress = getJobProgress(ConfigurationFileUtil.readFile("job-progress.yaml"));
- YamlJobProgress actual = JOB_PROGRESS_YAML_SWAPPER.swapToYaml(jobProgress);
+ YamlJobProgress actual = SWAPPER.swapToYaml(jobProgress);
assertThat(actual.getStatus(), is("RUNNING"));
assertThat(actual.getSourceDatabaseType(), is("H2"));
assertThat(actual.getInventory().getFinished().length, is(2));
@@ -56,14 +56,14 @@ public final class JobProgressYamlSwapperTest {
@Test
public void assertNullIncremental() {
JobProgress jobProgress = getJobProgress(ConfigurationFileUtil.readFile("job-progress-no-finished.yaml"));
- YamlJobProgress actual = JOB_PROGRESS_YAML_SWAPPER.swapToYaml(jobProgress);
+ YamlJobProgress actual = SWAPPER.swapToYaml(jobProgress);
assertTrue(actual.getIncremental().isEmpty());
}
@Test
public void assertNullInventory() {
JobProgress jobProgress = getJobProgress(ConfigurationFileUtil.readFile("job-progress-no-inventory.yaml"));
- YamlJobProgress actual = JOB_PROGRESS_YAML_SWAPPER.swapToYaml(jobProgress);
+ YamlJobProgress actual = SWAPPER.swapToYaml(jobProgress);
assertThat(actual.getInventory().getFinished().length, is(0));
}
}