congbobo184 commented on a change in pull request #12957:
URL: https://github.com/apache/pulsar/pull/12957#discussion_r763717783



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/common/naming/NamespaceBundleFactory.java
##########
@@ -212,16 +212,18 @@ public NamespaceBundle 
getBundleWithHighestThroughput(NamespaceName nsName) {
         if (loadManager instanceof ModularLoadManagerWrapper) {
             NamespaceBundles bundles = getBundles(nsName);
             double maxMsgThroughput = -1;
-            NamespaceBundle bundleWithHighestThroughpit = null;
+            NamespaceBundle bundleWithHighestThroughput = null;
             for (NamespaceBundle bundle : bundles.getBundles()) {
-                BundleData budnleData = ((ModularLoadManagerWrapper) 
loadManager).getLoadManager()
-                        .getBundleDataOrDefault(bundle.getBundleRange());
-                if (budnleData.getLongTermData().totalMsgThroughput() > 
maxMsgThroughput) {
-                    maxMsgThroughput = 
budnleData.getLongTermData().totalMsgThroughput();
-                    bundleWithHighestThroughpit = bundle;
+                BundleData bundleData = ((ModularLoadManagerWrapper) 
loadManager).getLoadManager()
+                        
.getBundleDataOrDefault(NamespaceBundle.getKey(bundle.getNamespaceObject(),
+                                bundle.getKeyRange()));
+                if (bundleData.getTopics() > 0

Review comment:
       why `bundleData.getTopics()` < 0 then 
bundleData.getLongTermData().totalMsgThroughput() > maxMsgThroughput? This 
situation shouldn't exist, right?




-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to