From b5bf2aff1e4f6ff4e6de40b480e058443c772dbe Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Thu, 7 Nov 2024 18:46:30 +0800 Subject: [PATCH] Remove useless StaticDataSourceRuleAttribute.getDataSourceMapper() (#33587) --- ...adwriteSplittingStaticDataSourceRuleAttribute.java | 11 ----------- .../datasource/StaticDataSourceRuleAttribute.java | 10 ---------- 2 files changed, 21 deletions(-) diff --git a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/attribute/ReadwriteSplittingStaticDataSourceRuleAttribute.java b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/attribute/ReadwriteSplittingStaticDataSourceRuleAttribute.java index 9603b525eb618..03234fb9e05c1 100644 --- a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/attribute/ReadwriteSplittingStaticDataSourceRuleAttribute.java +++ b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/attribute/ReadwriteSplittingStaticDataSourceRuleAttribute.java @@ -27,8 +27,6 @@ import org.apache.shardingsphere.readwritesplitting.exception.logic.ReadwriteSplittingDataSourceRuleNotFoundException; import org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingDataSourceGroupRule; -import java.util.Collection; -import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; @@ -44,15 +42,6 @@ public final class ReadwriteSplittingStaticDataSourceRuleAttribute implements St private final ComputeNodeInstanceContext computeNodeInstanceContext; - @Override - public Map> getDataSourceMapper() { - Map> result = new HashMap<>(dataSourceGroupRules.size(), 1F); - for (Entry entry : dataSourceGroupRules.entrySet()) { - result.put(entry.getValue().getName(), entry.getValue().getReadwriteSplittingGroup().getAllDataSources()); - } - return result; - } - @Override public void updateStatus(final QualifiedDataSource qualifiedDataSource, final DataSourceState status) { ReadwriteSplittingDataSourceGroupRule dataSourceGroupRule = dataSourceGroupRules.get(qualifiedDataSource.getGroupName()); diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/attribute/datasource/StaticDataSourceRuleAttribute.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/attribute/datasource/StaticDataSourceRuleAttribute.java index 5acac0697961a..5f75d17700f9d 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/attribute/datasource/StaticDataSourceRuleAttribute.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/rule/attribute/datasource/StaticDataSourceRuleAttribute.java @@ -21,21 +21,11 @@ import org.apache.shardingsphere.infra.rule.attribute.RuleAttribute; import org.apache.shardingsphere.infra.state.datasource.DataSourceState; -import java.util.Collection; -import java.util.Map; - /** * Static data source rule attribute. */ public interface StaticDataSourceRuleAttribute extends RuleAttribute { - /** - * Get data source mapper. - * - * @return data source mapper - */ - Map> getDataSourceMapper(); - /** * Update data source status. *