Demogorgon314 commented on code in PR #20552:
URL: https://github.com/apache/pulsar/pull/20552#discussion_r1224947752
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:
##########
@@ -180,6 +183,23 @@ 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();
+ return entrySet.stream()
+ .filter(entry -> {
+ var stateData = entry.getValue();
+ return stateData.state() == ServiceUnitState.Owned
+ && StringUtils.isNotBlank(stateData.dstBroker())
+ &&
stateData.dstBroker().equals(brokerRegistry.getBrokerId());
Review Comment:
Is repeated registry access will reduce performance?
--
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]