java.lang.Object
org.apache.pulsar.broker.loadbalance.extensions.scheduler.TransferShedder
All Implemented Interfaces:
NamespaceUnloadStrategy

public class TransferShedder extends Object implements NamespaceUnloadStrategy
Load shedding strategy that unloads bundles from the highest loaded brokers. This strategy is only configurable in the broker load balancer extensions introduced by PIP-192[https://github.com/apache/pulsar/issues/16691]. This load shedding strategy has the following goals: 1. Distribute bundle load across brokers in order to make the standard deviation of the avg resource usage, std(exponential-moving-avg(max(cpu, memory, network, throughput)) for each broker) below the target, configurable by loadBalancerBrokerLoadTargetStd. 2. Use the transfer protocol to transfer bundle load from the highest loaded to the lowest loaded brokers, if configured by loadBalancerTransferEnabled=true. 3. Avoid repeated bundle unloading by recomputing historical broker resource usage after unloading and also skipping the bundles that are recently unloaded. 4. Prioritize unloading bundles to underloaded brokers when their message throughput is zero(new brokers). 5. Do not use outdated broker load data (configurable by loadBalancerBrokerLoadDataTTLInSeconds). 6. Give enough time for each broker to recompute its load after unloading (configurable by loadBalanceUnloadDelayInSeconds) 7. Do not transfer bundles with namespace isolation policies or anti-affinity group policies. 8. Limit the max number of brokers to transfer bundle load for each cycle, (loadBalancerMaxNumberOfBrokerTransfersPerCycle). 9. Print more logs with a debug option(loadBalancerDebugModeEnabled=true).