This is an automated email from the ASF dual-hosted git repository.
yx9o 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 d07436fe5cf Refactor YamlDataNodeConfigurationSwapper (#31037)
d07436fe5cf is described below
commit d07436fe5cf8041b91a79be558f30752582049af
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Apr 28 19:22:19 2024 +0800
Refactor YamlDataNodeConfigurationSwapper (#31037)
---
...lBroadcastDataNodeRuleConfigurationSwapper.java | 6 ++--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...amlEncryptDataNodeRuleConfigurationSwapper.java | 10 +++---
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
.../YamlMaskDataNodeRuleConfigurationSwapper.java | 10 +++---
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...eSplittingDataNodeRuleConfigurationSwapper.java | 10 +++---
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...YamlShadowDataNodeRuleConfigurationSwapper.java | 10 +++---
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...mlShardingDataNodeRuleConfigurationSwapper.java | 10 +++---
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...YamlDataNodeGlobalRuleConfigurationSwapper.java | 39 ----------------------
...taNodeGlobalRuleConfigurationSwapperEngine.java | 9 ++---
.../rule/YamlDataNodeRuleConfigurationSwapper.java | 39 ----------------------
...YamlDataNodeRuleConfigurationSwapperEngine.java | 7 ++--
.../swapper/YamlDataNodeConfigurationSwapper.java | 12 ++++++-
...lAuthorityDataNodeRuleConfigurationSwapper.java | 6 ++--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...lobalClockDataNodeRuleConfigurationSwapper.java | 4 +--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...amlLoggingDataNodeRuleConfigurationSwapper.java | 4 +--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
.../database/rule/DatabaseRulePersistService.java | 8 ++---
.../config/global/GlobalRulePersistService.java | 4 +--
...YamlSingleDataNodeRuleConfigurationSwapper.java | 4 +--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...FederationDataNodeRuleConfigurationSwapper.java | 4 +--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...lSQLParserDataNodeRuleConfigurationSwapper.java | 4 +--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...TranslatorDataNodeRuleConfigurationSwapper.java | 4 +--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...amlTrafficDataNodeRuleConfigurationSwapper.java | 6 ++--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
...ransactionDataNodeRuleConfigurationSwapper.java | 4 +--
....yaml.swapper.YamlDataNodeConfigurationSwapper} | 0
.../context/ConfigurationContextManager.java | 4 +--
38 files changed, 76 insertions(+), 142 deletions(-)
diff --git
a/features/broadcast/core/src/main/java/org/apache/shardingsphere/broadcast/yaml/swapper/YamlBroadcastDataNodeRuleConfigurationSwapper.java
b/features/broadcast/core/src/main/java/org/apache/shardingsphere/broadcast/yaml/swapper/YamlBroadcastDataNodeRuleConfigurationSwapper.java
index 42e5d80af7d..71d41cc82a2 100644
---
a/features/broadcast/core/src/main/java/org/apache/shardingsphere/broadcast/yaml/swapper/YamlBroadcastDataNodeRuleConfigurationSwapper.java
+++
b/features/broadcast/core/src/main/java/org/apache/shardingsphere/broadcast/yaml/swapper/YamlBroadcastDataNodeRuleConfigurationSwapper.java
@@ -21,10 +21,10 @@ import
org.apache.shardingsphere.broadcast.api.config.BroadcastRuleConfiguration
import org.apache.shardingsphere.broadcast.constant.BroadcastOrder;
import
org.apache.shardingsphere.broadcast.metadata.nodepath.BroadcastRuleNodePathProvider;
import
org.apache.shardingsphere.broadcast.yaml.config.YamlBroadcastRuleConfiguration;
-import org.apache.shardingsphere.mode.path.RuleNodePath;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
+import org.apache.shardingsphere.mode.path.RuleNodePath;
import java.util.Collection;
import java.util.Collections;
@@ -35,7 +35,7 @@ import java.util.stream.Collectors;
/**
* YAML broadcast data node rule configuration swapper.
*/
-public final class YamlBroadcastDataNodeRuleConfigurationSwapper implements
YamlDataNodeRuleConfigurationSwapper<BroadcastRuleConfiguration> {
+public final class YamlBroadcastDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<BroadcastRuleConfiguration> {
private final RuleNodePath broadcastRuleNodePath = new
BroadcastRuleNodePathProvider().getRuleNodePath();
diff --git
a/features/broadcast/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
b/features/broadcast/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
features/broadcast/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
rename to
features/broadcast/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/YamlEncryptDataNodeRuleConfigurationSwapper.java
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/YamlEncryptDataNodeRuleConfigurationSwapper.java
index e17592be328..ca371b72045 100644
---
a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/YamlEncryptDataNodeRuleConfigurationSwapper.java
+++
b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/yaml/swapper/YamlEncryptDataNodeRuleConfigurationSwapper.java
@@ -24,12 +24,12 @@ import
org.apache.shardingsphere.encrypt.metadata.nodepath.EncryptRuleNodePathPr
import
org.apache.shardingsphere.encrypt.yaml.config.rule.YamlEncryptTableRuleConfiguration;
import
org.apache.shardingsphere.encrypt.yaml.swapper.rule.YamlEncryptTableRuleConfigurationSwapper;
import
org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
-import org.apache.shardingsphere.mode.path.RuleNodePath;
-import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
-import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper;
+import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
+import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
+import org.apache.shardingsphere.mode.path.RuleNodePath;
import java.util.Collection;
import java.util.LinkedHashMap;
@@ -43,7 +43,7 @@ import java.util.stream.Collectors;
/**
* YAML encrypt data node rule configuration swapper.
*/
-public final class YamlEncryptDataNodeRuleConfigurationSwapper implements
YamlDataNodeRuleConfigurationSwapper<EncryptRuleConfiguration> {
+public final class YamlEncryptDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<EncryptRuleConfiguration> {
private final YamlEncryptTableRuleConfigurationSwapper tableSwapper = new
YamlEncryptTableRuleConfigurationSwapper();
diff --git
a/features/encrypt/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
b/features/encrypt/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
features/encrypt/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
rename to
features/encrypt/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/features/mask/core/src/main/java/org/apache/shardingsphere/mask/yaml/swapper/YamlMaskDataNodeRuleConfigurationSwapper.java
b/features/mask/core/src/main/java/org/apache/shardingsphere/mask/yaml/swapper/YamlMaskDataNodeRuleConfigurationSwapper.java
index a9ca6dd7db9..f508b749dc4 100644
---
a/features/mask/core/src/main/java/org/apache/shardingsphere/mask/yaml/swapper/YamlMaskDataNodeRuleConfigurationSwapper.java
+++
b/features/mask/core/src/main/java/org/apache/shardingsphere/mask/yaml/swapper/YamlMaskDataNodeRuleConfigurationSwapper.java
@@ -18,18 +18,18 @@
package org.apache.shardingsphere.mask.yaml.swapper;
import
org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
-import org.apache.shardingsphere.mode.path.RuleNodePath;
-import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
-import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper;
+import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
+import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import org.apache.shardingsphere.mask.api.config.MaskRuleConfiguration;
import
org.apache.shardingsphere.mask.api.config.rule.MaskTableRuleConfiguration;
import org.apache.shardingsphere.mask.constant.MaskOrder;
import
org.apache.shardingsphere.mask.metadata.nodepath.MaskRuleNodePathProvider;
import
org.apache.shardingsphere.mask.yaml.config.rule.YamlMaskTableRuleConfiguration;
import
org.apache.shardingsphere.mask.yaml.swapper.rule.YamlMaskTableRuleConfigurationSwapper;
+import org.apache.shardingsphere.mode.path.RuleNodePath;
import java.util.Collection;
import java.util.LinkedHashMap;
@@ -43,7 +43,7 @@ import java.util.stream.Collectors;
/**
* YAML mask data node rule configuration swapper.
*/
-public final class YamlMaskDataNodeRuleConfigurationSwapper implements
YamlDataNodeRuleConfigurationSwapper<MaskRuleConfiguration> {
+public final class YamlMaskDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<MaskRuleConfiguration> {
private final YamlMaskTableRuleConfigurationSwapper tableSwapper = new
YamlMaskTableRuleConfigurationSwapper();
diff --git
a/features/mask/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
b/features/mask/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
features/mask/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
rename to
features/mask/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/swapper/YamlReadwriteSplittingDataNodeRuleConfigurationSwapper.java
b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/swapper/YamlReadwriteSplittingDataNodeRuleConfigurationSwapper.java
index f6455ff686c..425dc1725ea 100644
---
a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/swapper/YamlReadwriteSplittingDataNodeRuleConfigurationSwapper.java
+++
b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/yaml/swapper/YamlReadwriteSplittingDataNodeRuleConfigurationSwapper.java
@@ -19,12 +19,12 @@ package
org.apache.shardingsphere.readwritesplitting.yaml.swapper;
import com.google.common.base.Strings;
import
org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
-import org.apache.shardingsphere.mode.path.RuleNodePath;
-import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
-import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper;
+import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
+import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
+import org.apache.shardingsphere.mode.path.RuleNodePath;
import
org.apache.shardingsphere.readwritesplitting.api.ReadwriteSplittingRuleConfiguration;
import
org.apache.shardingsphere.readwritesplitting.api.rule.ReadwriteSplittingDataSourceGroupRuleConfiguration;
import
org.apache.shardingsphere.readwritesplitting.api.transaction.TransactionalReadQueryStrategy;
@@ -44,7 +44,7 @@ import java.util.stream.Collectors;
/**
* YAML readwrite-splitting data node rule configuration swapper.
*/
-public final class YamlReadwriteSplittingDataNodeRuleConfigurationSwapper
implements
YamlDataNodeRuleConfigurationSwapper<ReadwriteSplittingRuleConfiguration> {
+public final class YamlReadwriteSplittingDataNodeRuleConfigurationSwapper
implements
YamlDataNodeConfigurationSwapper<ReadwriteSplittingRuleConfiguration> {
private final YamlAlgorithmConfigurationSwapper algorithmSwapper = new
YamlAlgorithmConfigurationSwapper();
diff --git
a/features/readwrite-splitting/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
b/features/readwrite-splitting/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
features/readwrite-splitting/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
rename to
features/readwrite-splitting/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/yaml/swapper/YamlShadowDataNodeRuleConfigurationSwapper.java
b/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/yaml/swapper/YamlShadowDataNodeRuleConfigurationSwapper.java
index 7510b36e30f..9aaf70399db 100644
---
a/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/yaml/swapper/YamlShadowDataNodeRuleConfigurationSwapper.java
+++
b/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/yaml/swapper/YamlShadowDataNodeRuleConfigurationSwapper.java
@@ -19,12 +19,12 @@ package org.apache.shardingsphere.shadow.yaml.swapper;
import com.google.common.base.Strings;
import
org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
-import org.apache.shardingsphere.mode.path.RuleNodePath;
-import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
-import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper;
+import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
+import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
+import org.apache.shardingsphere.mode.path.RuleNodePath;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import
org.apache.shardingsphere.shadow.api.config.datasource.ShadowDataSourceConfiguration;
import
org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
@@ -44,7 +44,7 @@ import java.util.stream.Collectors;
/**
* YAML shadow data node rule configuration swapper.
*/
-public final class YamlShadowDataNodeRuleConfigurationSwapper implements
YamlDataNodeRuleConfigurationSwapper<ShadowRuleConfiguration> {
+public final class YamlShadowDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<ShadowRuleConfiguration> {
private final YamlShadowTableConfigurationSwapper tableSwapper = new
YamlShadowTableConfigurationSwapper();
diff --git
a/features/shadow/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
b/features/shadow/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
features/shadow/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
rename to
features/shadow/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/YamlShardingDataNodeRuleConfigurationSwapper.java
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/YamlShardingDataNodeRuleConfigurationSwapper.java
index 3d44648b0ff..9130de79d94 100644
---
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/YamlShardingDataNodeRuleConfigurationSwapper.java
+++
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/yaml/swapper/YamlShardingDataNodeRuleConfigurationSwapper.java
@@ -18,12 +18,12 @@
package org.apache.shardingsphere.sharding.yaml.swapper;
import
org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
-import org.apache.shardingsphere.mode.path.RuleNodePath;
-import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
-import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfiguration;
import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper;
+import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
+import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
+import org.apache.shardingsphere.mode.path.RuleNodePath;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.rule.ShardingAutoTableRuleConfiguration;
import
org.apache.shardingsphere.sharding.api.config.rule.ShardingTableReferenceRuleConfiguration;
@@ -54,7 +54,7 @@ import java.util.stream.Collectors;
/**
* YAML sharding data node rule configuration swapper.
*/
-public final class YamlShardingDataNodeRuleConfigurationSwapper implements
YamlDataNodeRuleConfigurationSwapper<ShardingRuleConfiguration> {
+public final class YamlShardingDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<ShardingRuleConfiguration> {
private final YamlShardingTableRuleConfigurationSwapper tableSwapper = new
YamlShardingTableRuleConfigurationSwapper();
diff --git
a/features/sharding/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
b/features/sharding/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
features/sharding/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
rename to
features/sharding/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeGlobalRuleConfigurationSwapper.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeGlobalRuleConfigurationSwapper.java
deleted file mode 100644
index 4effbe8357e..00000000000
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeGlobalRuleConfigurationSwapper.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.yaml.config.swapper.rule;
-
-import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
-import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPI;
-import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
-
-/**
- * YAML data node rule global configuration swapper.
- *
- * @param <T> type of rule configuration
- */
-@SingletonSPI
-public interface YamlDataNodeGlobalRuleConfigurationSwapper<T extends
RuleConfiguration> extends YamlDataNodeConfigurationSwapper<T>, OrderedSPI<T> {
-
- /**
- * Get YAML rule tag name.
- *
- * @return YAML rule tag name
- */
- String getRuleTagName();
-}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeGlobalRuleConfigurationSwapperEngine.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeGlobalRuleConfigurationSwapperEngine.java
index 24f6b30aecb..c5b6fd35971 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeGlobalRuleConfigurationSwapperEngine.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeGlobalRuleConfigurationSwapperEngine.java
@@ -20,6 +20,7 @@ package
org.apache.shardingsphere.infra.yaml.config.swapper.rule;
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
import org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPILoader;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import java.util.Collection;
import java.util.LinkedList;
@@ -38,8 +39,8 @@ public final class
YamlDataNodeGlobalRuleConfigurationSwapperEngine {
* @return YAML global rule configurations
*/
@SuppressWarnings("rawtypes")
- public Map<RuleConfiguration, YamlDataNodeGlobalRuleConfigurationSwapper>
swapToYamlRuleConfigurations(final Collection<RuleConfiguration> ruleConfigs) {
- return
OrderedSPILoader.getServices(YamlDataNodeGlobalRuleConfigurationSwapper.class,
ruleConfigs);
+ public Map<RuleConfiguration, YamlDataNodeConfigurationSwapper>
swapToYamlRuleConfigurations(final Collection<RuleConfiguration> ruleConfigs) {
+ return
OrderedSPILoader.getServices(YamlDataNodeConfigurationSwapper.class,
ruleConfigs);
}
/**
@@ -51,7 +52,7 @@ public final class
YamlDataNodeGlobalRuleConfigurationSwapperEngine {
@SuppressWarnings({"unchecked", "rawtypes"})
public Collection<RuleConfiguration> swapToRuleConfigurations(final
Collection<RepositoryTuple> repositoryTuples) {
Collection<RuleConfiguration> result = new LinkedList<>();
- for (YamlDataNodeGlobalRuleConfigurationSwapper each :
OrderedSPILoader.getServices(YamlDataNodeGlobalRuleConfigurationSwapper.class))
{
+ for (YamlDataNodeConfigurationSwapper each :
OrderedSPILoader.getServices(YamlDataNodeConfigurationSwapper.class)) {
each.swapToObject(repositoryTuples).ifPresent(optional ->
result.add((RuleConfiguration) optional));
}
return result;
@@ -66,7 +67,7 @@ public final class
YamlDataNodeGlobalRuleConfigurationSwapperEngine {
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public Optional<RuleConfiguration> swapSingleRuleToRuleConfiguration(final
String ruleName, final Collection<RepositoryTuple> repositoryTuples) {
- for (YamlDataNodeGlobalRuleConfigurationSwapper each :
OrderedSPILoader.getServices(YamlDataNodeGlobalRuleConfigurationSwapper.class))
{
+ for (YamlDataNodeConfigurationSwapper each :
OrderedSPILoader.getServices(YamlDataNodeConfigurationSwapper.class)) {
if (ruleName.equals(each.getRuleTagName().toLowerCase())) {
return each.swapToObject(repositoryTuples);
}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeRuleConfigurationSwapper.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeRuleConfigurationSwapper.java
deleted file mode 100644
index f6077407ee6..00000000000
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeRuleConfigurationSwapper.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.yaml.config.swapper.rule;
-
-import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
-import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
-import org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPI;
-import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
-
-/**
- * YAML data node rule configuration swapper.
- *
- * @param <T> type of rule configuration
- */
-@SingletonSPI
-public interface YamlDataNodeRuleConfigurationSwapper<T extends
RuleConfiguration> extends YamlDataNodeConfigurationSwapper<T>, OrderedSPI<T> {
-
- /**
- * Get YAML rule tag name.
- *
- * @return YAML rule tag name
- */
- String getRuleTagName();
-}
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeRuleConfigurationSwapperEngine.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeRuleConfigurationSwapperEngine.java
index f7ded204d6d..08ee2e80979 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeRuleConfigurationSwapperEngine.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/yaml/config/swapper/rule/YamlDataNodeRuleConfigurationSwapperEngine.java
@@ -20,6 +20,7 @@ package
org.apache.shardingsphere.infra.yaml.config.swapper.rule;
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
import org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPILoader;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import java.util.Collection;
import java.util.LinkedList;
@@ -37,8 +38,8 @@ public final class YamlDataNodeRuleConfigurationSwapperEngine
{
* @return YAML rule configurations
*/
@SuppressWarnings("rawtypes")
- public Map<RuleConfiguration, YamlDataNodeRuleConfigurationSwapper>
swapToYamlRuleConfigurations(final Collection<RuleConfiguration> ruleConfigs) {
- return
OrderedSPILoader.getServices(YamlDataNodeRuleConfigurationSwapper.class,
ruleConfigs);
+ public Map<RuleConfiguration, YamlDataNodeConfigurationSwapper>
swapToYamlRuleConfigurations(final Collection<RuleConfiguration> ruleConfigs) {
+ return
OrderedSPILoader.getServices(YamlDataNodeConfigurationSwapper.class,
ruleConfigs);
}
/**
@@ -50,7 +51,7 @@ public final class YamlDataNodeRuleConfigurationSwapperEngine
{
@SuppressWarnings({"unchecked", "rawtypes"})
public Collection<RuleConfiguration> swapToRuleConfigurations(final
Collection<RepositoryTuple> repositoryTuples) {
Collection<RuleConfiguration> result = new LinkedList<>();
- for (YamlDataNodeRuleConfigurationSwapper each :
OrderedSPILoader.getServices(YamlDataNodeRuleConfigurationSwapper.class)) {
+ for (YamlDataNodeConfigurationSwapper each :
OrderedSPILoader.getServices(YamlDataNodeConfigurationSwapper.class)) {
each.swapToObject(repositoryTuples).ifPresent(optional ->
result.add((RuleConfiguration) optional));
}
return result;
diff --git
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/yaml/swapper/YamlDataNodeConfigurationSwapper.java
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/yaml/swapper/YamlDataNodeConfigurationSwapper.java
index c16b69403ec..d9a0e521482 100644
---
a/infra/util/src/main/java/org/apache/shardingsphere/infra/util/yaml/swapper/YamlDataNodeConfigurationSwapper.java
+++
b/infra/util/src/main/java/org/apache/shardingsphere/infra/util/yaml/swapper/YamlDataNodeConfigurationSwapper.java
@@ -17,6 +17,8 @@
package org.apache.shardingsphere.infra.util.yaml.swapper;
+import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
+import org.apache.shardingsphere.infra.spi.type.ordered.OrderedSPI;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
import java.util.Collection;
@@ -27,7 +29,8 @@ import java.util.Optional;
*
* @param <T> type of swapped object
*/
-public interface YamlDataNodeConfigurationSwapper<T> {
+@SingletonSPI
+public interface YamlDataNodeConfigurationSwapper<T> extends OrderedSPI<T> {
/**
* Swap to repository tuples.
@@ -44,4 +47,11 @@ public interface YamlDataNodeConfigurationSwapper<T> {
* @return swapped object
*/
Optional<T> swapToObject(Collection<RepositoryTuple> repositoryTuples);
+
+ /**
+ * Get YAML rule tag name.
+ *
+ * @return YAML rule tag name
+ */
+ String getRuleTagName();
}
diff --git
a/kernel/authority/core/src/main/java/org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityDataNodeRuleConfigurationSwapper.java
b/kernel/authority/core/src/main/java/org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityDataNodeRuleConfigurationSwapper.java
index 13372304cc7..1db4c36b0d1 100644
---
a/kernel/authority/core/src/main/java/org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityDataNodeRuleConfigurationSwapper.java
+++
b/kernel/authority/core/src/main/java/org/apache/shardingsphere/authority/yaml/swapper/YamlAuthorityDataNodeRuleConfigurationSwapper.java
@@ -22,12 +22,12 @@ import
org.apache.shardingsphere.authority.constant.AuthorityOrder;
import
org.apache.shardingsphere.authority.rule.builder.DefaultAuthorityRuleConfigurationBuilder;
import
org.apache.shardingsphere.authority.yaml.config.YamlAuthorityRuleConfiguration;
import
org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
+import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper;
import org.apache.shardingsphere.infra.config.nodepath.GlobalNodePath;
import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import java.util.Collection;
import java.util.Collections;
@@ -39,7 +39,7 @@ import java.util.stream.Collectors;
/**
* YAML Authority data node rule configuration swapper.
*/
-public final class YamlAuthorityDataNodeRuleConfigurationSwapper implements
YamlDataNodeGlobalRuleConfigurationSwapper<AuthorityRuleConfiguration> {
+public final class YamlAuthorityDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<AuthorityRuleConfiguration> {
private final YamlUserSwapper userSwapper = new YamlUserSwapper();
diff --git
a/kernel/authority/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
b/kernel/authority/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
kernel/authority/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
rename to
kernel/authority/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/core/yaml/swapper/YamlGlobalClockDataNodeRuleConfigurationSwapper.java
b/kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/core/yaml/swapper/YamlGlobalClockDataNodeRuleConfigurationSwapper.java
index 9f55af563e0..e8c8f65e4d8 100644
---
a/kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/core/yaml/swapper/YamlGlobalClockDataNodeRuleConfigurationSwapper.java
+++
b/kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/core/yaml/swapper/YamlGlobalClockDataNodeRuleConfigurationSwapper.java
@@ -23,7 +23,7 @@ import
org.apache.shardingsphere.globalclock.core.yaml.config.YamlGlobalClockRul
import org.apache.shardingsphere.infra.config.nodepath.GlobalNodePath;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import java.util.Collection;
import java.util.Collections;
@@ -33,7 +33,7 @@ import java.util.Properties;
/**
* YAML global clock data node rule configuration swapper.
*/
-public final class YamlGlobalClockDataNodeRuleConfigurationSwapper implements
YamlDataNodeGlobalRuleConfigurationSwapper<GlobalClockRuleConfiguration> {
+public final class YamlGlobalClockDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<GlobalClockRuleConfiguration> {
@Override
public Collection<RepositoryTuple> swapToRepositoryTuples(final
GlobalClockRuleConfiguration data) {
diff --git
a/kernel/global-clock/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
b/kernel/global-clock/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
kernel/global-clock/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
rename to
kernel/global-clock/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/kernel/logging/core/src/main/java/org/apache/shardingsphere/logging/yaml/swapper/YamlLoggingDataNodeRuleConfigurationSwapper.java
b/kernel/logging/core/src/main/java/org/apache/shardingsphere/logging/yaml/swapper/YamlLoggingDataNodeRuleConfigurationSwapper.java
index a337a6e8ce8..01187d5701a 100644
---
a/kernel/logging/core/src/main/java/org/apache/shardingsphere/logging/yaml/swapper/YamlLoggingDataNodeRuleConfigurationSwapper.java
+++
b/kernel/logging/core/src/main/java/org/apache/shardingsphere/logging/yaml/swapper/YamlLoggingDataNodeRuleConfigurationSwapper.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.logging.yaml.swapper;
import org.apache.shardingsphere.infra.config.nodepath.GlobalNodePath;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import org.apache.shardingsphere.logging.config.LoggingRuleConfiguration;
import org.apache.shardingsphere.logging.constant.LoggingOrder;
import
org.apache.shardingsphere.logging.rule.builder.DefaultLoggingRuleConfigurationBuilder;
@@ -35,7 +35,7 @@ import java.util.Optional;
/**
* YAML logging data node rule configuration swapper.
*/
-public final class YamlLoggingDataNodeRuleConfigurationSwapper implements
YamlDataNodeGlobalRuleConfigurationSwapper<LoggingRuleConfiguration> {
+public final class YamlLoggingDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<LoggingRuleConfiguration> {
@Override
public Collection<RepositoryTuple> swapToRepositoryTuples(final
LoggingRuleConfiguration data) {
diff --git
a/kernel/logging/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
b/kernel/logging/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
kernel/logging/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
rename to
kernel/logging/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/database/rule/DatabaseRulePersistService.java
b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/database/rule/DatabaseRulePersistService.java
index 6c978497661..6d54596810f 100644
---
a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/database/rule/DatabaseRulePersistService.java
+++
b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/database/rule/DatabaseRulePersistService.java
@@ -21,7 +21,7 @@ import com.google.common.base.Strings;
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
import org.apache.shardingsphere.infra.metadata.version.MetaDataVersion;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapperEngine;
import
org.apache.shardingsphere.metadata.persist.node.metadata.DatabaseRuleMetaDataNode;
import
org.apache.shardingsphere.metadata.persist.service.config.RepositoryTuplePersistService;
@@ -53,7 +53,7 @@ public final class DatabaseRulePersistService implements
DatabaseBasedPersistSer
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void persist(final String databaseName, final
Collection<RuleConfiguration> configs) {
- for (Entry<RuleConfiguration, YamlDataNodeRuleConfigurationSwapper>
entry : new
YamlDataNodeRuleConfigurationSwapperEngine().swapToYamlRuleConfigurations(configs).entrySet())
{
+ for (Entry<RuleConfiguration, YamlDataNodeConfigurationSwapper> entry
: new
YamlDataNodeRuleConfigurationSwapperEngine().swapToYamlRuleConfigurations(configs).entrySet())
{
Collection<RepositoryTuple> repositoryTuples =
entry.getValue().swapToRepositoryTuples(entry.getKey());
if (!repositoryTuples.isEmpty()) {
persistDataNodes(databaseName,
entry.getValue().getRuleTagName().toLowerCase(), repositoryTuples);
@@ -76,7 +76,7 @@ public final class DatabaseRulePersistService implements
DatabaseBasedPersistSer
@Override
public Collection<MetaDataVersion> persistConfigurations(final String
databaseName, final Collection<RuleConfiguration> configs) {
Collection<MetaDataVersion> result = new LinkedList<>();
- for (Entry<RuleConfiguration, YamlDataNodeRuleConfigurationSwapper>
entry : new
YamlDataNodeRuleConfigurationSwapperEngine().swapToYamlRuleConfigurations(configs).entrySet())
{
+ for (Entry<RuleConfiguration, YamlDataNodeConfigurationSwapper> entry
: new
YamlDataNodeRuleConfigurationSwapperEngine().swapToYamlRuleConfigurations(configs).entrySet())
{
Collection<RepositoryTuple> repositoryTuples =
entry.getValue().swapToRepositoryTuples(entry.getKey());
if (!repositoryTuples.isEmpty()) {
result.addAll(persistDataNodes(databaseName,
entry.getValue().getRuleTagName().toLowerCase(), repositoryTuples));
@@ -103,7 +103,7 @@ public final class DatabaseRulePersistService implements
DatabaseBasedPersistSer
@Override
public Collection<MetaDataVersion> deleteConfigurations(final String
databaseName, final Collection<RuleConfiguration> configs) {
Collection<MetaDataVersion> result = new LinkedList<>();
- for (Entry<RuleConfiguration, YamlDataNodeRuleConfigurationSwapper>
entry : new
YamlDataNodeRuleConfigurationSwapperEngine().swapToYamlRuleConfigurations(configs).entrySet())
{
+ for (Entry<RuleConfiguration, YamlDataNodeConfigurationSwapper> entry
: new
YamlDataNodeRuleConfigurationSwapperEngine().swapToYamlRuleConfigurations(configs).entrySet())
{
Collection<RepositoryTuple> repositoryTuples =
entry.getValue().swapToRepositoryTuples(entry.getKey());
if (repositoryTuples.isEmpty()) {
continue;
diff --git
a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistService.java
b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistService.java
index aae50b2ab20..02a69bf1e72 100644
---
a/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistService.java
+++
b/kernel/metadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/service/config/global/GlobalRulePersistService.java
@@ -21,7 +21,7 @@ import com.google.common.base.Strings;
import org.apache.shardingsphere.infra.config.rule.RuleConfiguration;
import org.apache.shardingsphere.infra.metadata.version.MetaDataVersion;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapperEngine;
import org.apache.shardingsphere.metadata.persist.node.GlobalNode;
import
org.apache.shardingsphere.metadata.persist.service.config.RepositoryTuplePersistService;
@@ -57,7 +57,7 @@ public final class GlobalRulePersistService implements
GlobalPersistService<Coll
@Override
public void persist(final Collection<RuleConfiguration> globalRuleConfigs)
{
Collection<MetaDataVersion> metaDataVersions = new LinkedList<>();
- for (Entry<RuleConfiguration,
YamlDataNodeGlobalRuleConfigurationSwapper> entry : new
YamlDataNodeGlobalRuleConfigurationSwapperEngine()
+ for (Entry<RuleConfiguration, YamlDataNodeConfigurationSwapper> entry
: new YamlDataNodeGlobalRuleConfigurationSwapperEngine()
.swapToYamlRuleConfigurations(globalRuleConfigs).entrySet()) {
Collection<RepositoryTuple> repositoryTuples =
entry.getValue().swapToRepositoryTuples(entry.getKey());
if (!repositoryTuples.isEmpty()) {
diff --git
a/kernel/single/core/src/main/java/org/apache/shardingsphere/single/yaml/config/swapper/YamlSingleDataNodeRuleConfigurationSwapper.java
b/kernel/single/core/src/main/java/org/apache/shardingsphere/single/yaml/config/swapper/YamlSingleDataNodeRuleConfigurationSwapper.java
index a110ad63c02..e4d07b607c9 100644
---
a/kernel/single/core/src/main/java/org/apache/shardingsphere/single/yaml/config/swapper/YamlSingleDataNodeRuleConfigurationSwapper.java
+++
b/kernel/single/core/src/main/java/org/apache/shardingsphere/single/yaml/config/swapper/YamlSingleDataNodeRuleConfigurationSwapper.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.single.yaml.config.swapper;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import org.apache.shardingsphere.mode.path.RuleNodePath;
import org.apache.shardingsphere.single.api.config.SingleRuleConfiguration;
import org.apache.shardingsphere.single.constant.SingleOrder;
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
/**
* YAML single data node rule configuration swapper.
*/
-public final class YamlSingleDataNodeRuleConfigurationSwapper implements
YamlDataNodeRuleConfigurationSwapper<SingleRuleConfiguration> {
+public final class YamlSingleDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<SingleRuleConfiguration> {
private final RuleNodePath singleRuleNodePath = new
SingleRuleNodePathProvider().getRuleNodePath();
diff --git
a/kernel/single/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
b/kernel/single/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
kernel/single/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeRuleConfigurationSwapper
rename to
kernel/single/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/yaml/swapper/YamlSQLFederationDataNodeRuleConfigurationSwapper.java
b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/yaml/swapper/YamlSQLFederationDataNodeRuleConfigurationSwapper.java
index 3fdaff69800..683f95ef916 100644
---
a/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/yaml/swapper/YamlSQLFederationDataNodeRuleConfigurationSwapper.java
+++
b/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/yaml/swapper/YamlSQLFederationDataNodeRuleConfigurationSwapper.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sqlfederation.yaml.swapper;
import org.apache.shardingsphere.infra.config.nodepath.GlobalNodePath;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import org.apache.shardingsphere.sql.parser.api.CacheOption;
import
org.apache.shardingsphere.sqlfederation.api.config.SQLFederationRuleConfiguration;
import org.apache.shardingsphere.sqlfederation.constant.SQLFederationOrder;
@@ -33,7 +33,7 @@ import java.util.Optional;
/**
* YAML SQL federation data node rule configuration swapper.
*/
-public final class YamlSQLFederationDataNodeRuleConfigurationSwapper
implements
YamlDataNodeGlobalRuleConfigurationSwapper<SQLFederationRuleConfiguration> {
+public final class YamlSQLFederationDataNodeRuleConfigurationSwapper
implements YamlDataNodeConfigurationSwapper<SQLFederationRuleConfiguration> {
private final YamlSQLFederationExecutionPlanCacheConfigurationSwapper
executionPlanCacheConfigSwapper = new
YamlSQLFederationExecutionPlanCacheConfigurationSwapper();
diff --git
a/kernel/sql-federation/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
b/kernel/sql-federation/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
kernel/sql-federation/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
rename to
kernel/sql-federation/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/kernel/sql-parser/core/src/main/java/org/apache/shardingsphere/parser/yaml/swapper/YamlSQLParserDataNodeRuleConfigurationSwapper.java
b/kernel/sql-parser/core/src/main/java/org/apache/shardingsphere/parser/yaml/swapper/YamlSQLParserDataNodeRuleConfigurationSwapper.java
index b0faec97661..61486a68068 100644
---
a/kernel/sql-parser/core/src/main/java/org/apache/shardingsphere/parser/yaml/swapper/YamlSQLParserDataNodeRuleConfigurationSwapper.java
+++
b/kernel/sql-parser/core/src/main/java/org/apache/shardingsphere/parser/yaml/swapper/YamlSQLParserDataNodeRuleConfigurationSwapper.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.parser.yaml.swapper;
import org.apache.shardingsphere.infra.config.nodepath.GlobalNodePath;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import org.apache.shardingsphere.parser.config.SQLParserRuleConfiguration;
import org.apache.shardingsphere.parser.constant.SQLParserOrder;
import
org.apache.shardingsphere.parser.rule.builder.DefaultSQLParserRuleConfigurationBuilder;
@@ -34,7 +34,7 @@ import java.util.Optional;
/**
* YAML SQL parser data node rule configuration swapper.
*/
-public final class YamlSQLParserDataNodeRuleConfigurationSwapper implements
YamlDataNodeGlobalRuleConfigurationSwapper<SQLParserRuleConfiguration> {
+public final class YamlSQLParserDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<SQLParserRuleConfiguration> {
private final YamlSQLParserCacheOptionConfigurationSwapper
cacheOptionSwapper = new YamlSQLParserCacheOptionConfigurationSwapper();
diff --git
a/kernel/sql-parser/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
b/kernel/sql-parser/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
kernel/sql-parser/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
rename to
kernel/sql-parser/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/kernel/sql-translator/core/src/main/java/org/apache/shardingsphere/sqltranslator/yaml/swapper/YamlSQLTranslatorDataNodeRuleConfigurationSwapper.java
b/kernel/sql-translator/core/src/main/java/org/apache/shardingsphere/sqltranslator/yaml/swapper/YamlSQLTranslatorDataNodeRuleConfigurationSwapper.java
index e107bc056a5..52202e84a14 100644
---
a/kernel/sql-translator/core/src/main/java/org/apache/shardingsphere/sqltranslator/yaml/swapper/YamlSQLTranslatorDataNodeRuleConfigurationSwapper.java
+++
b/kernel/sql-translator/core/src/main/java/org/apache/shardingsphere/sqltranslator/yaml/swapper/YamlSQLTranslatorDataNodeRuleConfigurationSwapper.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.sqltranslator.yaml.swapper;
import org.apache.shardingsphere.infra.config.nodepath.GlobalNodePath;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import
org.apache.shardingsphere.sqltranslator.api.config.SQLTranslatorRuleConfiguration;
import org.apache.shardingsphere.sqltranslator.constant.SQLTranslatorOrder;
import
org.apache.shardingsphere.sqltranslator.yaml.config.YamlSQLTranslatorRuleConfiguration;
@@ -32,7 +32,7 @@ import java.util.Optional;
/**
* YAML SQL translator data node rule configuration swapper.
*/
-public final class YamlSQLTranslatorDataNodeRuleConfigurationSwapper
implements
YamlDataNodeGlobalRuleConfigurationSwapper<SQLTranslatorRuleConfiguration> {
+public final class YamlSQLTranslatorDataNodeRuleConfigurationSwapper
implements YamlDataNodeConfigurationSwapper<SQLTranslatorRuleConfiguration> {
@Override
public Collection<RepositoryTuple> swapToRepositoryTuples(final
SQLTranslatorRuleConfiguration data) {
diff --git
a/kernel/sql-translator/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
b/kernel/sql-translator/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
kernel/sql-translator/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
rename to
kernel/sql-translator/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficDataNodeRuleConfigurationSwapper.java
b/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficDataNodeRuleConfigurationSwapper.java
index 8156072e6a4..e5ac92df2c7 100644
---
a/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficDataNodeRuleConfigurationSwapper.java
+++
b/kernel/traffic/core/src/main/java/org/apache/shardingsphere/traffic/yaml/swapper/YamlTrafficDataNodeRuleConfigurationSwapper.java
@@ -17,11 +17,11 @@
package org.apache.shardingsphere.traffic.yaml.swapper;
+import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper;
import org.apache.shardingsphere.infra.config.nodepath.GlobalNodePath;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.algorithm.core.yaml.YamlAlgorithmConfigurationSwapper;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import org.apache.shardingsphere.traffic.api.config.TrafficRuleConfiguration;
import org.apache.shardingsphere.traffic.constant.TrafficOrder;
import
org.apache.shardingsphere.traffic.yaml.config.YamlTrafficRuleConfiguration;
@@ -35,7 +35,7 @@ import java.util.Optional;
/**
* YAML traffic data node rule configuration swapper.
*/
-public final class YamlTrafficDataNodeRuleConfigurationSwapper implements
YamlDataNodeGlobalRuleConfigurationSwapper<TrafficRuleConfiguration> {
+public final class YamlTrafficDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<TrafficRuleConfiguration> {
private final YamlTrafficStrategyConfigurationSwapper strategySwapper =
new YamlTrafficStrategyConfigurationSwapper();
diff --git
a/kernel/traffic/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
b/kernel/traffic/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
kernel/traffic/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
rename to
kernel/traffic/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/yaml/swapper/YamlTransactionDataNodeRuleConfigurationSwapper.java
b/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/yaml/swapper/YamlTransactionDataNodeRuleConfigurationSwapper.java
index 92c6193413d..1e4c721030f 100644
---
a/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/yaml/swapper/YamlTransactionDataNodeRuleConfigurationSwapper.java
+++
b/kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/yaml/swapper/YamlTransactionDataNodeRuleConfigurationSwapper.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.transaction.yaml.swapper;
import org.apache.shardingsphere.infra.config.nodepath.GlobalNodePath;
import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
import org.apache.shardingsphere.infra.util.yaml.datanode.RepositoryTuple;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import
org.apache.shardingsphere.transaction.config.TransactionRuleConfiguration;
import org.apache.shardingsphere.transaction.constant.TransactionOrder;
import
org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfiguration;
@@ -33,7 +33,7 @@ import java.util.Properties;
/**
* YAML Transaction data node rule configuration swapper.
*/
-public final class YamlTransactionDataNodeRuleConfigurationSwapper implements
YamlDataNodeGlobalRuleConfigurationSwapper<TransactionRuleConfiguration> {
+public final class YamlTransactionDataNodeRuleConfigurationSwapper implements
YamlDataNodeConfigurationSwapper<TransactionRuleConfiguration> {
@Override
public Collection<RepositoryTuple> swapToRepositoryTuples(final
TransactionRuleConfiguration data) {
diff --git
a/kernel/transaction/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
b/kernel/transaction/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
similarity index 100%
rename from
kernel/transaction/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper
rename to
kernel/transaction/core/src/main/resources/META-INF/services/org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper
diff --git
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ConfigurationContextManager.java
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ConfigurationContextManager.java
index 55364ba0489..73831f41e9e 100644
---
a/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ConfigurationContextManager.java
+++
b/mode/core/src/main/java/org/apache/shardingsphere/mode/manager/context/ConfigurationContextManager.java
@@ -38,7 +38,7 @@ import
org.apache.shardingsphere.infra.metadata.database.schema.model.ShardingSp
import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
import
org.apache.shardingsphere.infra.rule.builder.database.DatabaseRulesBuilder;
import org.apache.shardingsphere.infra.rule.builder.global.GlobalRulesBuilder;
-import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapper;
+import
org.apache.shardingsphere.infra.util.yaml.swapper.YamlDataNodeConfigurationSwapper;
import
org.apache.shardingsphere.infra.yaml.config.swapper.rule.YamlDataNodeGlobalRuleConfigurationSwapperEngine;
import org.apache.shardingsphere.metadata.factory.ExternalMetaDataFactory;
import org.apache.shardingsphere.metadata.factory.InternalMetaDataFactory;
@@ -376,7 +376,7 @@ public final class ConfigurationContextManager {
@SuppressWarnings("rawtypes")
@SneakyThrows(Exception.class)
private void closeStaleTransactionRule(final RuleConfiguration ruleConfig)
{
- for (Entry<RuleConfiguration,
YamlDataNodeGlobalRuleConfigurationSwapper> entry : new
YamlDataNodeGlobalRuleConfigurationSwapperEngine()
+ for (Entry<RuleConfiguration, YamlDataNodeConfigurationSwapper> entry
: new YamlDataNodeGlobalRuleConfigurationSwapperEngine()
.swapToYamlRuleConfigurations(Collections.singleton(ruleConfig)).entrySet()) {
if
("transaction".equalsIgnoreCase(entry.getValue().getRuleTagName())) {
Optional<TransactionRule> transactionRule =
metaDataContexts.get().getMetaData().getGlobalRuleMetaData().findSingleRule(TransactionRule.class);