Class ModularLoadManagerWrapper

java.lang.Object
org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerWrapper
All Implemented Interfaces:
LoadManager

public class ModularLoadManagerWrapper extends Object implements LoadManager
Wrapper class allowing classes of instance ModularLoadManager to be compatible with the interface LoadManager.
  • Constructor Details

    • ModularLoadManagerWrapper

      public ModularLoadManagerWrapper(ModularLoadManager loadManager)
  • Method Details

    • disableBroker

      public void disableBroker() throws Exception
      Description copied from interface: LoadManager
      Removes visibility of current broker from loadbalancer list so, other brokers can't redirect any request to this broker and this broker won't accept new connection requests.
      Specified by:
      disableBroker in interface LoadManager
      Throws:
      Exception
    • doLoadShedding

      public void doLoadShedding()
      Description copied from interface: LoadManager
      Unload a candidate service unit to balance the load.
      Specified by:
      doLoadShedding in interface LoadManager
    • doNamespaceBundleSplit

      public void doNamespaceBundleSplit()
      Description copied from interface: LoadManager
      Namespace bundle split.
      Specified by:
      doNamespaceBundleSplit in interface LoadManager
    • generateLoadReport

      public org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport generateLoadReport()
      Description copied from interface: LoadManager
      Generate the load report.
      Specified by:
      generateLoadReport in interface LoadManager
    • getLeastLoaded

      public Optional<ResourceUnit> getLeastLoaded(org.apache.pulsar.common.naming.ServiceUnitId serviceUnit)
      Description copied from interface: LoadManager
      Returns the Least Loaded Resource Unit decided by some algorithm or criteria which is implementation specific.
      Specified by:
      getLeastLoaded in interface LoadManager
    • getLoadBalancingMetrics

      public List<org.apache.pulsar.common.stats.Metrics> getLoadBalancingMetrics()
      Description copied from interface: LoadManager
      Generate load balancing stats metrics.
      Specified by:
      getLoadBalancingMetrics in interface LoadManager
    • initialize

      public void initialize(PulsarService pulsar)
      Description copied from interface: LoadManager
      Initialize this LoadManager.
      Specified by:
      initialize in interface LoadManager
      Parameters:
      pulsar - The service to initialize this with.
    • isCentralized

      public boolean isCentralized()
      Description copied from interface: LoadManager
      Is centralized decision making to assign a new bundle.
      Specified by:
      isCentralized in interface LoadManager
    • setLoadReportForceUpdateFlag

      public void setLoadReportForceUpdateFlag()
      Description copied from interface: LoadManager
      Set flag to force load report update.
      Specified by:
      setLoadReportForceUpdateFlag in interface LoadManager
    • start

      public void start() throws org.apache.pulsar.broker.PulsarServerException
      Specified by:
      start in interface LoadManager
      Throws:
      org.apache.pulsar.broker.PulsarServerException
    • stop

      public void stop() throws org.apache.pulsar.broker.PulsarServerException
      Specified by:
      stop in interface LoadManager
      Throws:
      org.apache.pulsar.broker.PulsarServerException
    • writeLoadReportOnZookeeper

      public void writeLoadReportOnZookeeper()
      Description copied from interface: LoadManager
      Publish the current load report on ZK.
      Specified by:
      writeLoadReportOnZookeeper in interface LoadManager
    • writeLoadReportOnZookeeper

      public void writeLoadReportOnZookeeper(boolean force)
      Description copied from interface: LoadManager
      Publish the current load report on ZK, forced or not. By default rely on method writeLoadReportOnZookeeper().
      Specified by:
      writeLoadReportOnZookeeper in interface LoadManager
    • writeResourceQuotasToZooKeeper

      public void writeResourceQuotasToZooKeeper()
      Description copied from interface: LoadManager
      Update namespace bundle resource quota on ZK.
      Specified by:
      writeResourceQuotasToZooKeeper in interface LoadManager
    • getLoadManager

      public ModularLoadManager getLoadManager()
    • getAvailableBrokers

      public Set<String> getAvailableBrokers() throws Exception
      Description copied from interface: LoadManager
      Get list of available brokers in cluster.
      Specified by:
      getAvailableBrokers in interface LoadManager
      Returns:
      Throws:
      Exception
    • getAvailableBrokersAsync

      public CompletableFuture<Set<String>> getAvailableBrokersAsync()
      Specified by:
      getAvailableBrokersAsync in interface LoadManager