heesung-sn commented on code in PR #19708:
URL: https://github.com/apache/pulsar/pull/19708#discussion_r1129936768
##########
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(
final PulsarService pulsar, final String namespaceName,
- final ConcurrentOpenHashMap<String, ConcurrentOpenHashMap<String,
ConcurrentOpenHashSet<String>>>
- brokerToNamespaceToBundleRange) {
+ Object bundleOwnershipData) {
Review Comment:
This ownershipData can be large. It could unnecessarily increase space and
time complexity if we convert them to the temporary list just to reuse this
function. We can have overloaded functions(with minimal duplicated code) for
these different ownership data structures.
I added the overloaded functions.
--
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]