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



##########
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:
       I don't think so, 
   `bundleData.getTopics() > 0` condition  makes sure that  this bundle is 
owned by broker. which is  precondition of `split-bundle`




-- 
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]


Reply via email to