strongduanmu commented on code in PR #19604:
URL: https://github.com/apache/shardingsphere/pull/19604#discussion_r930994818
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/config/ProxyConfigurationLoader.java:
##########
@@ -105,9 +111,31 @@ private static Optional<YamlProxyDatabaseConfiguration>
loadDatabaseConfiguratio
result.setDatabaseName(result.getSchemaName());
}
Preconditions.checkNotNull(result.getDatabaseName(), "Property
`databaseName` in file `%s` is required.", yamlFile.getName());
+ checkDuplicateRule(result.getRules(), yamlFile);
return Optional.of(result);
}
+ private static void checkDuplicateRule(final
Collection<YamlRuleConfiguration> ruleConfigurations, final File yamlFile) {
+ if (ruleConfigurations.isEmpty()) {
+ return;
+ }
+ Multiset<Class<? extends RuleConfiguration>> multiset =
HashMultiset.create();
Review Comment:
Can we remove guava set here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]