Class UniformLoadShedder

java.lang.Object
org.apache.pulsar.broker.loadbalance.impl.UniformLoadShedder
All Implemented Interfaces:
LoadSheddingStrategy

public class UniformLoadShedder extends 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.getLoadBalancerMsgThroughputMultiplierDifferenceShedderThreshold() then it finds out bundles which can be unloaded to distribute traffic evenly across all brokers.
  • Constructor Details

    • UniformLoadShedder

      public UniformLoadShedder()
  • Method Details

    • findBundlesForUnloading

      public com.google.common.collect.Multimap<String,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.