Class DeviationShedder
java.lang.Object
org.apache.pulsar.broker.loadbalance.impl.DeviationShedder
- All Implemented Interfaces:
LoadSheddingStrategy
An abstract class which makes a LoadSheddingStrategy which makes decisions based on standard deviation easier to
implement. Assuming there exists some real number metric which may estimate the load on a server, this load shedding
strategy calculates the standard deviation with respect to that metric and sheds load on brokers whose standard
deviation is above some threshold.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract doublebrokerValue(org.apache.pulsar.policies.data.loadbalancer.BrokerData brokerData, org.apache.pulsar.broker.ServiceConfiguration conf) protected abstract doublebundleValue(String bundle, org.apache.pulsar.policies.data.loadbalancer.BrokerData brokerData, org.apache.pulsar.broker.ServiceConfiguration conf) findBundlesForUnloading(LoadData loadData, org.apache.pulsar.broker.ServiceConfiguration conf) Recommend that all of the returned bundles be unloaded based on observing excessive standard deviations according to some metric.protected abstract doublegetDeviationThreshold(org.apache.pulsar.broker.ServiceConfiguration conf) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.broker.loadbalance.LoadSheddingStrategy
onActiveBrokersChange
-
Field Details
-
metricTreeSetCache
-
bundleTreeSetCache
-
-
Constructor Details
-
DeviationShedder
public DeviationShedder()Initialize this DeviationShedder.
-
-
Method Details
-
bundleValue
protected abstract double bundleValue(String bundle, org.apache.pulsar.policies.data.loadbalancer.BrokerData brokerData, org.apache.pulsar.broker.ServiceConfiguration conf) -
brokerValue
protected abstract double brokerValue(org.apache.pulsar.policies.data.loadbalancer.BrokerData brokerData, org.apache.pulsar.broker.ServiceConfiguration conf) -
getDeviationThreshold
protected abstract double getDeviationThreshold(org.apache.pulsar.broker.ServiceConfiguration conf) -
findBundlesForUnloading
public com.google.common.collect.Multimap<String,String> findBundlesForUnloading(LoadData loadData, org.apache.pulsar.broker.ServiceConfiguration conf) Recommend that all of the returned bundles be unloaded based on observing excessive standard deviations according to some metric.- Specified by:
findBundlesForUnloadingin interfaceLoadSheddingStrategy- Parameters:
loadData- The load data to used to make the unloading decision.conf- The service configuration.- Returns:
- A map from all selected bundles to the brokers on which they reside.
-