From 611d5e2f816962ebe341114a6ba34c23db7976e0 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Mon, 4 Nov 2024 20:13:51 +0800 Subject: [PATCH] Refactor ReadwriteSplittingDataSourceMapperRuleAttribute (#33541) --- .../ReadwriteSplittingDataSourceMapperRuleAttribute.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/attribute/ReadwriteSplittingDataSourceMapperRuleAttribute.java b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/attribute/ReadwriteSplittingDataSourceMapperRuleAttribute.java index c71d74c8e2693..d421c164b6301 100644 --- a/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/attribute/ReadwriteSplittingDataSourceMapperRuleAttribute.java +++ b/features/readwrite-splitting/core/src/main/java/org/apache/shardingsphere/readwritesplitting/rule/attribute/ReadwriteSplittingDataSourceMapperRuleAttribute.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingDataSourceGroupRule; import java.util.Collection; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; /** @@ -37,7 +37,7 @@ public final class ReadwriteSplittingDataSourceMapperRuleAttribute implements Da @HighFrequencyInvocation @Override public Map> getDataSourceMapper() { - Map> result = new HashMap<>(dataSourceGroupRules.size(), 1F); + Map> result = new LinkedHashMap<>(dataSourceGroupRules.size(), 1F); for (ReadwriteSplittingDataSourceGroupRule each : dataSourceGroupRules) { result.put(each.getName(), each.getReadwriteSplittingGroup().getAllDataSources()); }