You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2025/02/25 01:50:51 UTC
(shardingsphere) branch master updated: Refactor YamlRepositoryTupleSwapperEngine (#34783)
This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 7d25e1b9336 Refactor YamlRepositoryTupleSwapperEngine (#34783)
7d25e1b9336 is described below
commit 7d25e1b93368f6df12b04f9b5805f0bd9a7515a7
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Tue Feb 25 09:50:45 2025 +0800
Refactor YamlRepositoryTupleSwapperEngine (#34783)
---
.../mode/node/tuple/YamlRepositoryTupleSwapperEngine.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/tuple/YamlRepositoryTupleSwapperEngine.java b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/tuple/YamlRepositoryTupleSwapperEngine.java
index 8bc2cd6b91f..b86c39d38c5 100644
--- a/mode/node/src/main/java/org/apache/shardingsphere/mode/node/tuple/YamlRepositoryTupleSwapperEngine.java
+++ b/mode/node/src/main/java/org/apache/shardingsphere/mode/node/tuple/YamlRepositoryTupleSwapperEngine.java
@@ -74,11 +74,10 @@ public final class YamlRepositoryTupleSwapperEngine {
return Collections.singleton(new RepositoryTuple(tupleEntity.value(), YamlEngine.marshal(yamlRuleConfig)));
}
Collection<RepositoryTuple> result = new LinkedList<>();
- DatabaseRuleNode databaseRuleNode = TypedSPILoader.getService(DatabaseRuleNodeProvider.class, yamlRuleConfig.getRuleConfigurationType()).getDatabaseRuleNode();
for (Field each : getFields(yamlRuleConfig.getClass())) {
boolean isAccessible = each.isAccessible();
each.setAccessible(true);
- result.addAll(swapToRepositoryTuples(yamlRuleConfig, databaseRuleNode, each));
+ result.addAll(swapToRepositoryTuples(yamlRuleConfig, each));
each.setAccessible(isAccessible);
}
return result;
@@ -86,7 +85,7 @@ public final class YamlRepositoryTupleSwapperEngine {
@SneakyThrows(ReflectiveOperationException.class)
@SuppressWarnings("rawtypes")
- private Collection<RepositoryTuple> swapToRepositoryTuples(final YamlRuleConfiguration yamlRuleConfig, final DatabaseRuleNode databaseRuleNode, final Field field) {
+ private Collection<RepositoryTuple> swapToRepositoryTuples(final YamlRuleConfiguration yamlRuleConfig, final Field field) {
Object fieldValue = field.get(yamlRuleConfig);
if (null == fieldValue) {
return Collections.emptyList();