Interface ModularLoadManagerStrategy

All Known Implementing Classes:
AvgShedder, LeastLongTermMessageRate, LeastResourceUsageWithWeight, RoundRobinBrokerSelector

public interface ModularLoadManagerStrategy
Interface which serves as a component for ModularLoadManagerImpl, flexibly allowing the injection of potentially complex strategies.
  • Method Details

    • selectBroker

      Optional<String> selectBroker(Set<String> candidates, org.apache.pulsar.policies.data.loadbalancer.BundleData bundleToAssign, LoadData loadData, ServiceConfiguration conf)
      Find a suitable broker to assign the given bundle to.
      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.
    • onActiveBrokersChange

      default void onActiveBrokersChange(Set<String> activeBrokers)
      Triggered when active brokers change.
    • create

      Create a placement strategy using the configuration.
      Parameters:
      conf - ServiceConfiguration to use.
      Returns:
      A placement strategy from the given configurations.