Class LeastLongTermMessageRate

java.lang.Object
org.apache.pulsar.broker.loadbalance.impl.LeastLongTermMessageRate
All Implemented Interfaces:
ModularLoadManagerStrategy

public class LeastLongTermMessageRate extends Object implements ModularLoadManagerStrategy
Placement strategy which selects a broker based on which one has the least long term message rate.
  • Constructor Details

    • LeastLongTermMessageRate

      public LeastLongTermMessageRate()
  • Method Details

    • selectBroker

      public Optional<String> selectBroker(Set<String> candidates, org.apache.pulsar.policies.data.loadbalancer.BundleData bundleToAssign, LoadData loadData, org.apache.pulsar.broker.ServiceConfiguration conf)
      Find a suitable broker to assign the given bundle to.
      Specified by:
      selectBroker in interface ModularLoadManagerStrategy
      Parameters:
      candidates - The candidates for which the bundle may be assigned.
      bundleToAssign - The data for the bundle to assign.
      loadData - The load data from the leader broker.
      conf - The service configuration.
      Returns:
      The name of the selected broker as it appears on ZooKeeper.