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 7eb662eef8e Refactor ShadowRule (#33946)
7eb662eef8e is described below
commit 7eb662eef8e2c71053143f933feed71cb0d4e90c
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Dec 6 23:14:48 2024 +0800
Refactor ShadowRule (#33946)
---
.../main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java
b/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java
index d67d1ecf603..aa3d3781533 100644
---
a/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java
+++
b/features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/rule/ShadowRule.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.shadow.rule;
+import com.cedarsoftware.util.CaseInsensitiveMap;
import lombok.Getter;
import
org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
import org.apache.shardingsphere.infra.annotation.HighFrequencyInvocation;
@@ -77,12 +78,13 @@ public final class ShadowRule implements DatabaseRule {
private Map<String, ShadowDataSourceRule> createDataSourceRules(final
Collection<ShadowDataSourceConfiguration> dataSourceConfigs) {
return
dataSourceConfigs.stream().collect(Collectors.toMap(ShadowDataSourceConfiguration::getName,
- each -> new
ShadowDataSourceRule(each.getProductionDataSourceName(),
each.getShadowDataSourceName()), (a, b) -> b, LinkedHashMap::new));
+ each -> new
ShadowDataSourceRule(each.getProductionDataSourceName(),
each.getShadowDataSourceName()), (a, b) -> b, CaseInsensitiveMap::new));
}
private Map<String, ShadowTableRule> createTableRules(final Map<String,
ShadowTableConfiguration> tableConfigs) {
return
tableConfigs.entrySet().stream().collect(Collectors.toMap(Entry::getKey,
- entry -> new ShadowTableRule(entry.getKey(),
entry.getValue().getDataSourceNames(),
entry.getValue().getShadowAlgorithmNames(), shadowAlgorithms), (a, b) -> b,
LinkedHashMap::new));
+ entry -> new ShadowTableRule(entry.getKey(),
entry.getValue().getDataSourceNames(),
entry.getValue().getShadowAlgorithmNames(), shadowAlgorithms),
+ (a, b) -> b, CaseInsensitiveMap::new));
}
/**