Class RoundRobinBrokerSelector

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

public class RoundRobinBrokerSelector extends Object implements ModularLoadManagerStrategy
Simple Round Robin Broker Selection Strategy.
  • Constructor Details

    • RoundRobinBrokerSelector

      public RoundRobinBrokerSelector()
  • Method Details

    • selectBroker

      public Optional<String> selectBroker(Set<String> candidates, org.apache.pulsar.policies.data.loadbalancer.BundleData bundleToAssign, LoadData loadData, ServiceConfiguration conf)
      Description copied from interface: ModularLoadManagerStrategy
      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.