Class UniformLoadShedder
- java.lang.Object
-
- org.apache.pulsar.broker.loadbalance.impl.UniformLoadShedder
-
- All Implemented Interfaces:
LoadSheddingStrategy
public class UniformLoadShedder extends java.lang.Object implements LoadSheddingStrategy
This strategy tends to distribute load uniformly across all brokers. This strategy checks load difference between broker with highest load and broker with lowest load. If the difference is higher than configured thresholdsServiceConfiguration.getLoadBalancerMsgRateDifferenceShedderThreshold()orServiceConfiguration#loadBalancerMsgThroughputMultiplierDifferenceShedderThreshold()then it finds out bundles which can be unloaded to distribute traffic evenly across all brokers.
-
-
Constructor Summary
Constructors Constructor Description UniformLoadShedder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.Multimap<java.lang.String,java.lang.String>findBundlesForUnloading(LoadData loadData, org.apache.pulsar.broker.ServiceConfiguration conf)Attempt to shed some bundles off every broker which is overloaded.
-
-
-
Method Detail
-
findBundlesForUnloading
public com.google.common.collect.Multimap<java.lang.String,java.lang.String> findBundlesForUnloading(LoadData loadData, org.apache.pulsar.broker.ServiceConfiguration conf)
Attempt to shed some bundles off every broker which is overloaded.- Specified by:
findBundlesForUnloadingin interfaceLoadSheddingStrategy- Parameters:
loadData- The load data to used to make the unloading decision.conf- The service configuration.- Returns:
- A map from bundles to unload to the brokers on which they are loaded.
-
-