menghaoranss commented on a change in pull request #10481:
URL: https://github.com/apache/shardingsphere/pull/10481#discussion_r640279842



##########
File path: 
shardingsphere-governance/shardingsphere-governance-context/src/main/java/org/apache/shardingsphere/governance/context/metadata/GovernanceMetaDataContexts.java
##########
@@ -418,5 +422,29 @@ private boolean isModifiedDataSource(final Map<String, 
DataSource> oldDataSource
         return result;
     }
     
+    private ShardingSphereRuleMetaData getChangedGlobalRuleMetaData(final 
AuthorityChangedEvent event) {
+        Optional<AuthorityRuleConfiguration> authorityRuleConfig = 
metaDataContexts.getGlobalRuleMetaData().getConfigurations().stream().filter(each
 -> each instanceof AuthorityRuleConfiguration)
+                .findAny().map(each -> (AuthorityRuleConfiguration) each);
+        Collection<RuleConfiguration> globalRuleConfigs = new 
LinkedList<>(metaDataContexts.getGlobalRuleMetaData().getConfigurations());
+        globalRuleConfigs.remove(authorityRuleConfig.get());

Review comment:
       I‘m not sure if authorityRuleConfig needs to be confirmed isPresent




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to