You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by te...@apache.org on 2024/01/17 11:34:50 UTC
(pulsar) branch master updated: [fix][broker] Fix typos in UniformLoadShedder class (#21907)
This is an automated email from the ASF dual-hosted git repository.
technoboy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new fdeb191a946 [fix][broker] Fix typos in UniformLoadShedder class (#21907)
fdeb191a946 is described below
commit fdeb191a946a76ca5edde81464f453fcd03fc6d3
Author: hanmz <gu...@tencent.com>
AuthorDate: Wed Jan 17 19:34:43 2024 +0800
[fix][broker] Fix typos in UniformLoadShedder class (#21907)
---
.../apache/pulsar/broker/loadbalance/impl/UniformLoadShedder.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/UniformLoadShedder.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/UniformLoadShedder.java
index e3055246f4b..78bdbc57112 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/UniformLoadShedder.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/UniformLoadShedder.java
@@ -137,7 +137,7 @@ public class UniformLoadShedder implements LoadSheddingStrategy {
brokersData.get(msgRateOverloadedBroker.getValue()).getLocalData();
if (overloadedBrokerData.getBundles().size() > 1
&& (msgRateRequiredFromUnloadedBundles.getValue() >= conf.getMinUnloadMessage())) {
- // Sort bundles by throughput, then pick the bundle which can help to reduce load uniformly with
+ // Sort bundles by msgRate, then pick the bundle which can help to reduce load uniformly with
// under-loaded broker
loadBundleData.entrySet().stream()
.filter(e -> overloadedBrokerData.getBundles().contains(e.getKey()))
@@ -182,9 +182,9 @@ public class UniformLoadShedder implements LoadSheddingStrategy {
.map((e) -> {
String bundle = e.getKey();
TimeAverageMessageData shortTermData = e.getValue().getShortTermData();
- double msgThroughtput = shortTermData.getMsgThroughputIn()
+ double msgThroughput = shortTermData.getMsgThroughputIn()
+ shortTermData.getMsgThroughputOut();
- return Pair.of(bundle, msgThroughtput);
+ return Pair.of(bundle, msgThroughput);
}).filter(e -> !recentlyUnloadedBundles.containsKey(e.getLeft()))
.sorted((e1, e2) -> Double.compare(e2.getRight(), e1.getRight())).forEach((e) -> {
if (conf.getMaxUnloadBundleNumPerShedding() != -1