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 2021/12/07 07:55:17 UTC

[GitHub] [pulsar] gaozhangmin commented on a change in pull request #12957: fix pr #12378

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



##########
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:
       there is a default value 50000. this situation may exists.




-- 
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-unsubscribe@pulsar.apache.org

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