You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/07/27 09:09:10 UTC

[GitHub] [shardingsphere] LeeGuoPing opened a new pull request, #19604: Fixed In one config, can config two - !SHARDING bug

LeeGuoPing opened a new pull request, #19604:
URL: https://github.com/apache/shardingsphere/pull/19604

   Fixes #18755 .
   
   Changes proposed in this pull request:
   -
   -
   -
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #19604: Fixed In one config, can config two - !SHARDING bug

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] LeeGuoPing commented on a diff in pull request #19604: Fixed In one config, can config two - !SHARDING bug

Posted by GitBox <gi...@apache.org>.
LeeGuoPing commented on code in PR #19604:
URL: https://github.com/apache/shardingsphere/pull/19604#discussion_r931699969


##########
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:
   removed



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu merged pull request #19604: Fixed In one config, can config two - !SHARDING bug

Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #19604:
URL: https://github.com/apache/shardingsphere/pull/19604


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org