Class 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 thresholds ServiceConfiguration.getLoadBalancerMsgRateDifferenceShedderThreshold() or ServiceConfiguration#loadBalancerMsgThroughputMultiplierDifferenceShedderThreshold() then it finds out bundles which can be unloaded to distribute traffic evenly across all brokers.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UniformLoadShedder

        public UniformLoadShedder()
    • 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:
        findBundlesForUnloading in interface LoadSheddingStrategy
        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.