gaoran10 commented on code in PR #21213:
URL: https://github.com/apache/pulsar/pull/21213#discussion_r1339410658
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensions/ExtensibleLoadManagerImpl.java:
##########
@@ -377,25 +416,38 @@ public CompletableFuture<Optional<BrokerLookupData>>
assign(Optional<ServiceUnit
if (topic.isPresent() && isInternalTopic(topic.get().toString())) {
owner = serviceUnitStateChannel.getChannelOwnerAsync();
} else {
- owner = getOwnerAsync(serviceUnit, bundle,
false).thenApply(Optional::ofNullable);
+ String candidateBrokerId =
getHeartbeatOrSLAMonitorBrokerId(serviceUnit);
+ if (candidateBrokerId != null) {
+ owner =
CompletableFuture.completedFuture(Optional.of(candidateBrokerId));
+ } else {
+ owner = getOrSelectOwnerAsync(serviceUnit,
bundle).thenApply(Optional::ofNullable);
+ }
}
return getBrokerLookupData(owner, bundle);
});
}
- private CompletableFuture<String> getOwnerAsync(
- ServiceUnitId serviceUnit, String bundle, boolean
ownByLocalBrokerIfAbsent) {
+ private String getHeartbeatOrSLAMonitorBrokerId(ServiceUnitId serviceUnit)
{
Review Comment:
OK
--
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]