Interface ModularLoadManagerStrategy

All Known Implementing Classes:
LeastLongTermMessageRate, LeastResourceUsageWithWeight

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

    Modifier and Type
    Method
    Description
    create(org.apache.pulsar.broker.ServiceConfiguration conf)
    Create a placement strategy using the configuration.
    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.
  • Method Details

    • selectBroker

      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.
      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.
    • create

      static ModularLoadManagerStrategy create(org.apache.pulsar.broker.ServiceConfiguration conf)
      Create a placement strategy using the configuration.
      Parameters:
      conf - ServiceConfiguration to use.
      Returns:
      A placement strategy from the given configurations.