gaoran10 commented on code in PR #19708:
URL: https://github.com/apache/pulsar/pull/19708#discussion_r1130573036


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:
##########
@@ -161,6 +175,13 @@ public void start() throws PulsarServerException {
         } catch (LoadDataStoreException e) {
             throw new PulsarServerException(e);
         }
+        LoadManagerShared.refreshBrokerToFailureDomainMap(pulsar, 
brokerToFailureDomainMap);
+        // register listeners for domain changes
+        
pulsar.getPulsarResources().getClusterResources().getFailureDomainResources()
+                .registerListener(__ -> {
+                    pulsar.getLoadManagerExecutor().execute(() ->
+                            
LoadManagerShared.refreshBrokerToFailureDomainMap(pulsar, 
brokerToFailureDomainMap));
+                });

Review Comment:
   Does the field `antiAffinityGroupPolicyHelper` is necessary? Can we change 
it to a local variable.



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:
##########
@@ -161,6 +175,13 @@ public void start() throws PulsarServerException {
         } catch (LoadDataStoreException e) {
             throw new PulsarServerException(e);
         }
+        LoadManagerShared.refreshBrokerToFailureDomainMap(pulsar, 
brokerToFailureDomainMap);
+        // register listeners for domain changes
+        
pulsar.getPulsarResources().getClusterResources().getFailureDomainResources()
+                .registerListener(__ -> {
+                    pulsar.getLoadManagerExecutor().execute(() ->
+                            
LoadManagerShared.refreshBrokerToFailureDomainMap(pulsar, 
brokerToFailureDomainMap));
+                });

Review Comment:
   Does the field `antiAffinityGroupPolicyHelper` is necessary? Can we change 
it to a local variable?



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

Reply via email to