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



##########
File path: 
shardingsphere-governance/shardingsphere-governance-context/src/main/java/org/apache/shardingsphere/governance/context/metadata/GovernanceMetaDataContexts.java
##########
@@ -320,6 +322,22 @@ public synchronized void renew(final 
PrimaryStateChangedEvent event) {
         }
     }
     
+    /**
+     * Renew global rule configurations.
+     *
+     * @param event global rule configurations changed event
+     */
+    @Subscribe
+    public synchronized void renew(final GlobalRuleConfigurationsChangedEvent 
event) {
+        Collection<RuleConfiguration> newGlobalConfigs = 
event.getRuleConfigurations();
+        if (!newGlobalConfigs.isEmpty()) {
+            ShardingSphereRuleMetaData newGlobalRuleMetaData = new 
ShardingSphereRuleMetaData(newGlobalConfigs,
+                    
ShardingSphereRulesBuilder.buildGlobalRules(newGlobalConfigs, 
metaDataContexts.getMetaDataMap()));
+            metaDataContexts = new StandardMetaDataContexts(
+                    metaDataContexts.getMetaDataMap(), newGlobalRuleMetaData, 
metaDataContexts.getExecutorEngine(), metaDataContexts.getUsers(), 
metaDataContexts.getProps());

Review comment:
       Should `metaDataContexts.getUsers()` be retrieved from newGlobalConfigs?




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