Class OverloadShedder

  • All Implemented Interfaces:
    LoadSheddingStrategy

    public class OverloadShedder
    extends java.lang.Object
    implements LoadSheddingStrategy
    Load shedding strategy which will attempt to shed exactly one bundle on brokers which are overloaded, that is, whose maximum system resource usage exceeds loadBalancerBrokerOverloadedThresholdPercentage. To see which resources are considered when determining the maximum system resource, see LocalBrokerData.getMaxResourceUsage(). A bundle is recommended for unloading off that broker if and only if the following conditions hold: The broker has at least two bundles assigned and the broker has at least one bundle that has not been unloaded recently according to LoadBalancerSheddingGracePeriodMinutes. The unloaded bundle will be the most expensive bundle in terms of message rate that has not been recently unloaded. Note that this strategy does not take into account "underloaded" brokers when determining which bundles to unload. If you are looking for a strategy that spreads load evenly across all brokers, see ThresholdShedder.
    • Constructor Summary

      Constructors 
      Constructor Description
      OverloadShedder()  
    • 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

      • OverloadShedder

        public OverloadShedder()
    • 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.