Skip to content

Commit

Permalink
Fix data source out of order causing load metadata not right problem. (
Browse files Browse the repository at this point in the history
…#28943)

* Refactor example

* Fixed data source out of order causing load metadata not right problem.
  • Loading branch information
zhaojinchao95 authored Nov 5, 2023
1 parent 32ac80e commit 405379c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public static Collection<ShardingSphereRule> build(final String databaseName, fi
for (Entry<RuleConfiguration, DatabaseRuleBuilder> entry : getRuleBuilderMap(databaseConfig).entrySet()) {
RuleConfigurationChecker configChecker = OrderedSPILoader.getServicesByClass(
RuleConfigurationChecker.class, Collections.singleton(entry.getKey().getClass())).get(entry.getKey().getClass());
Map<String, DataSource> dataSources = databaseConfig.getStorageUnits().entrySet().stream().collect(Collectors.toMap(Entry::getKey, storageUnit -> storageUnit.getValue().getDataSource()));
Map<String, DataSource> dataSources = databaseConfig.getStorageUnits().entrySet().stream()
.collect(Collectors.toMap(Entry::getKey, storageUnit -> storageUnit.getValue().getDataSource(), (oldValue, currentValue) -> oldValue, LinkedHashMap::new));
if (null != configChecker) {
configChecker.check(databaseName, entry.getKey(), dataSources, result);
}
Expand Down

0 comments on commit 405379c

Please sign in to comment.