You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/01/27 00:12:13 UTC

[GitHub] rdhabalia commented on a change in pull request #1122: Use Optional for returning least loaded broker

rdhabalia commented on a change in pull request #1122: Use Optional<String> for returning least loaded broker
URL: https://github.com/apache/incubator-pulsar/pull/1122#discussion_r164251429
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
 ##########
 @@ -460,20 +460,19 @@ private boolean isBrokerActive(String candidateBroker) throws KeeperException, I
      * @throws Exception
      */
     private Optional<String> getLeastLoadedFromLoadManager(ServiceUnitId serviceUnit) throws Exception {
-        ResourceUnit leastLoadedBroker = loadManager.get().getLeastLoaded(serviceUnit);
-        if (leastLoadedBroker != null) {
-            String lookupAddress = leastLoadedBroker.getResourceId();
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("{} : redirecting to the least loaded broker, lookup address={}",
-                        pulsar.getWebServiceAddress(), lookupAddress);
-            }
-            return Optional.of(lookupAddress);
-        } else {
-            LOG.warn("No broker is available for {}", serviceUnit);
 
 Review comment:
   can we keep this warn message?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services