Class NoopLoadManager
- java.lang.Object
-
- org.apache.pulsar.broker.loadbalance.NoopLoadManager
-
- All Implemented Interfaces:
LoadManager
public class NoopLoadManager extends java.lang.Object implements LoadManager
-
-
Field Summary
-
Fields inherited from interface org.apache.pulsar.broker.loadbalance.LoadManager
LOADBALANCE_BROKERS_ROOT, LOG
-
-
Constructor Summary
Constructors Constructor Description NoopLoadManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableBroker()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.voiddoLoadShedding()Unload a candidate service unit to balance the load.voiddoNamespaceBundleSplit()Namespace bundle split.org.apache.pulsar.policies.data.loadbalancer.LoadManagerReportgenerateLoadReport()Generate the load report.java.util.Set<java.lang.String>getAvailableBrokers()Get list of available brokers in cluster.java.util.Optional<ResourceUnit>getLeastLoaded(org.apache.pulsar.common.naming.ServiceUnitId su)Returns the Least Loaded Resource Unit decided by some algorithm or criteria which is implementation specific.java.util.List<org.apache.pulsar.common.stats.Metrics>getLoadBalancingMetrics()Generate load balancing stats metrics.voidinitialize(PulsarService pulsar)Initialize this LoadManager.booleanisCentralized()Is centralized decision making to assign a new bundle.voidsetLoadReportForceUpdateFlag()Set flag to force load report update.voidstart()voidstop()voidwriteLoadReportOnZookeeper()Publish the current load report on ZK.voidwriteResourceQuotasToZooKeeper()Update namespace bundle resource quota on ZK.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pulsar.broker.loadbalance.LoadManager
writeLoadReportOnZookeeper
-
-
-
-
Method Detail
-
initialize
public void initialize(PulsarService pulsar)
Description copied from interface:LoadManagerInitialize this LoadManager.- Specified by:
initializein interfaceLoadManager- Parameters:
pulsar- The service to initialize this with.
-
start
public void start() throws org.apache.pulsar.broker.PulsarServerException- Specified by:
startin interfaceLoadManager- Throws:
org.apache.pulsar.broker.PulsarServerException
-
isCentralized
public boolean isCentralized()
Description copied from interface:LoadManagerIs centralized decision making to assign a new bundle.- Specified by:
isCentralizedin interfaceLoadManager
-
getLeastLoaded
public java.util.Optional<ResourceUnit> getLeastLoaded(org.apache.pulsar.common.naming.ServiceUnitId su) throws java.lang.Exception
Description copied from interface:LoadManagerReturns the Least Loaded Resource Unit decided by some algorithm or criteria which is implementation specific.- Specified by:
getLeastLoadedin interfaceLoadManager- Throws:
java.lang.Exception
-
generateLoadReport
public org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport generateLoadReport() throws java.lang.ExceptionDescription copied from interface:LoadManagerGenerate the load report.- Specified by:
generateLoadReportin interfaceLoadManager- Throws:
java.lang.Exception
-
setLoadReportForceUpdateFlag
public void setLoadReportForceUpdateFlag()
Description copied from interface:LoadManagerSet flag to force load report update.- Specified by:
setLoadReportForceUpdateFlagin interfaceLoadManager
-
writeLoadReportOnZookeeper
public void writeLoadReportOnZookeeper() throws java.lang.ExceptionDescription copied from interface:LoadManagerPublish the current load report on ZK.- Specified by:
writeLoadReportOnZookeeperin interfaceLoadManager- Throws:
java.lang.Exception
-
writeResourceQuotasToZooKeeper
public void writeResourceQuotasToZooKeeper() throws java.lang.ExceptionDescription copied from interface:LoadManagerUpdate namespace bundle resource quota on ZK.- Specified by:
writeResourceQuotasToZooKeeperin interfaceLoadManager- Throws:
java.lang.Exception
-
getLoadBalancingMetrics
public java.util.List<org.apache.pulsar.common.stats.Metrics> getLoadBalancingMetrics()
Description copied from interface:LoadManagerGenerate load balancing stats metrics.- Specified by:
getLoadBalancingMetricsin interfaceLoadManager
-
doLoadShedding
public void doLoadShedding()
Description copied from interface:LoadManagerUnload a candidate service unit to balance the load.- Specified by:
doLoadSheddingin interfaceLoadManager
-
doNamespaceBundleSplit
public void doNamespaceBundleSplit() throws java.lang.ExceptionDescription copied from interface:LoadManagerNamespace bundle split.- Specified by:
doNamespaceBundleSplitin interfaceLoadManager- Throws:
java.lang.Exception
-
disableBroker
public void disableBroker() throws java.lang.ExceptionDescription copied from interface:LoadManagerRemoves 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:
disableBrokerin interfaceLoadManager- Throws:
java.lang.Exception
-
getAvailableBrokers
public java.util.Set<java.lang.String> getAvailableBrokers() throws java.lang.ExceptionDescription copied from interface:LoadManagerGet list of available brokers in cluster.- Specified by:
getAvailableBrokersin interfaceLoadManager- Returns:
- Throws:
java.lang.Exception
-
stop
public void stop() throws org.apache.pulsar.broker.PulsarServerException- Specified by:
stopin interfaceLoadManager- Throws:
org.apache.pulsar.broker.PulsarServerException
-
-