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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LoadManagerShared.java:
##########
@@ -409,22 +413,23 @@ private static void 
filterDomainsNotHavingLeastNumberAntiAffinityNamespaces(
             return nsCount != null && nsCount != finalLeastNamespaceCount;
         });
     }
-
+    @FunctionalInterface
+    private interface CountAntiAffinityNamespaceOwnedBrokers{
+        void run(String broker, String namespace);
+    }
     /**
      * It returns map of broker and count of namespace that are belong to the 
same anti-affinity group as given.
      *
      * @param pulsar
      * @param namespaceName
-     * @param brokerToNamespaceToBundleRange
+     * @param bundleOwnershipData
      * @return
      */
     public static CompletableFuture<Map<String, Integer>> 
getAntiAffinityNamespaceOwnedBrokers(

Review Comment:
   It's confusing to use an Object type param. Actually, the method needs a 
list of data pairs (broker -> namespace), maybe the caller can filter invalid 
data, and prepare the data first.
   
   For `ModularLoadManagerImpl`, convert `ConcurrentOpenHashMap` to a List, and 
filter empty bundle ranges, then call this method.
   For `ExtensibleLoadManagerImpl.java`, convert `Set` to a List, and filter 
bundles with an invalid state, then call this method.



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