Class ModularLoadManagerWrapper
java.lang.Object
org.apache.pulsar.broker.loadbalance.impl.ModularLoadManagerWrapper
- All Implemented Interfaces:
LoadManager
Wrapper class allowing classes of instance ModularLoadManager to be compatible with the interface LoadManager.
-
Field Summary
Fields inherited from interface org.apache.pulsar.broker.loadbalance.LoadManager
LOADBALANCE_BROKERS_ROOT, LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves 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.voidUnload a candidate service unit to balance the load.voidNamespace bundle split.org.apache.pulsar.policies.data.loadbalancer.LoadManagerReportGenerate the load report.Get list of available brokers in cluster.getLeastLoaded(org.apache.pulsar.common.naming.ServiceUnitId serviceUnit) Returns the Least Loaded Resource Unit decided by some algorithm or criteria which is implementation specific.List<org.apache.pulsar.common.stats.Metrics>Generate load balancing stats metrics.voidinitialize(PulsarService pulsar) Initialize this LoadManager.booleanIs centralized decision making to assign a new bundle.voidSet flag to force load report update.setNamespaceBundleAffinity(String bundle, String broker) voidstart()voidstop()voidPublish the current load report on ZK.voidwriteLoadReportOnZookeeper(boolean force) Publish the current load report on ZK, forced or not.voidUpdate namespace bundle resource quota on ZK.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.broker.loadbalance.LoadManager
checkOwnershipAsync, findBrokerServiceUrl, started
-
Constructor Details
-
ModularLoadManagerWrapper
-
-
Method Details
-
disableBroker
Description 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:
Exception- if there is any error while disabling broker
-
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()Description copied from interface:LoadManagerNamespace bundle split.- Specified by:
doNamespaceBundleSplitin interfaceLoadManager
-
generateLoadReport
public org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport generateLoadReport()Description copied from interface:LoadManagerGenerate the load report.- Specified by:
generateLoadReportin interfaceLoadManager
-
getLeastLoaded
public Optional<ResourceUnit> getLeastLoaded(org.apache.pulsar.common.naming.ServiceUnitId serviceUnit) Description copied from interface:LoadManagerReturns the Least Loaded Resource Unit decided by some algorithm or criteria which is implementation specific.- Specified by:
getLeastLoadedin interfaceLoadManager
-
getLoadBalancingMetrics
Description copied from interface:LoadManagerGenerate load balancing stats metrics.- Specified by:
getLoadBalancingMetricsin interfaceLoadManager
-
initialize
Description copied from interface:LoadManagerInitialize this LoadManager.- Specified by:
initializein interfaceLoadManager- Parameters:
pulsar- The service to initialize this with.
-
isCentralized
public boolean isCentralized()Description copied from interface:LoadManagerIs centralized decision making to assign a new bundle.- Specified by:
isCentralizedin interfaceLoadManager
-
setLoadReportForceUpdateFlag
public void setLoadReportForceUpdateFlag()Description copied from interface:LoadManagerSet flag to force load report update.- Specified by:
setLoadReportForceUpdateFlagin interfaceLoadManager
-
start
- Specified by:
startin interfaceLoadManager- Throws:
PulsarServerException
-
stop
- Specified by:
stopin interfaceLoadManager- Throws:
PulsarServerException
-
writeLoadReportOnZookeeper
public void writeLoadReportOnZookeeper()Description copied from interface:LoadManagerPublish the current load report on ZK.- Specified by:
writeLoadReportOnZookeeperin interfaceLoadManager
-
writeLoadReportOnZookeeper
public void writeLoadReportOnZookeeper(boolean force) Description copied from interface:LoadManagerPublish the current load report on ZK, forced or not. By default, rely on method writeLoadReportOnZookeeper().- Specified by:
writeLoadReportOnZookeeperin interfaceLoadManager
-
writeResourceQuotasToZooKeeper
public void writeResourceQuotasToZooKeeper()Description copied from interface:LoadManagerUpdate namespace bundle resource quota on ZK.- Specified by:
writeResourceQuotasToZooKeeperin interfaceLoadManager
-
getLoadManager
-
getAvailableBrokers
Description copied from interface:LoadManagerGet list of available brokers in cluster.- Specified by:
getAvailableBrokersin interfaceLoadManager- Returns:
- the list of available brokers
- Throws:
Exception- if there is any error while getting available brokers
-
getAvailableBrokersAsync
- Specified by:
getAvailableBrokersAsyncin interfaceLoadManager
-
setNamespaceBundleAffinity
- Specified by:
setNamespaceBundleAffinityin interfaceLoadManager
-