Class ModularLoadManagerWrapper

  • All Implemented Interfaces:
    LoadManager

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

      • ModularLoadManagerWrapper

        public ModularLoadManagerWrapper​(ModularLoadManager loadManager)
    • Method Detail

      • disableBroker

        public void disableBroker()
                           throws java.lang.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:
        java.lang.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
      • 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 java.util.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 java.util.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
      • 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​(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
      • getAvailableBrokers

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