mattisonchao commented on code in PR #20552:
URL: https://github.com/apache/pulsar/pull/20552#discussion_r1226269887


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:
##########
@@ -180,6 +184,24 @@ public class ExtensibleLoadManagerImpl implements 
ExtensibleLoadManager {
             .build();
     private final CountDownLatch initWaiter = new CountDownLatch(1);
 
+    /**
+     * Get all the bundles that are owned by this broker.
+     */
+    public Set<NamespaceBundle> getOwnedServiceUnits() {
+        var entrySet = serviceUnitStateChannel.getOwnershipEntrySet();
+        var brokerId = brokerRegistry.getBrokerId();

Review Comment:
   IMO, It's ok to use `var` in the new features. Since we are already in the 
JDK17 and `var` will help avoid very long code causes us to have to break code 
into multiple lines to follow `checkstyle` rule.
   For existing code, we should avoid using any new API&Feature to avoid get 
compile error when cherry-pick patch to previous branches.



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