public interface LoadManager
| Modifier and Type | Field and Description |
|---|---|
static String |
LOADBALANCE_BROKERS_ROOT |
static org.slf4j.Logger |
LOG |
| Modifier and Type | Method and Description |
|---|---|
static LoadManager |
create(PulsarService pulsar) |
void |
disableBroker()
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.
|
void |
doLoadShedding()
Unload a candidate service unit to balance the load.
|
void |
doNamespaceBundleSplit()
Namespace bundle split.
|
org.apache.pulsar.policies.data.loadbalancer.LoadManagerReport |
generateLoadReport()
Generate the load report.
|
Set<String> |
getAvailableBrokers()
Get list of available brokers in cluster.
|
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.
|
List<org.apache.pulsar.common.stats.Metrics> |
getLoadBalancingMetrics()
Generate load balancing stats metrics.
|
void |
initialize(PulsarService pulsar)
Initialize this LoadManager.
|
boolean |
isCentralized()
Is centralized decision making to assign a new bundle.
|
void |
setLoadReportForceUpdateFlag()
Set flag to force load report update.
|
void |
start() |
void |
stop() |
void |
writeLoadReportOnZookeeper()
Publish the current load report on ZK.
|
default void |
writeLoadReportOnZookeeper(boolean force)
Publish the current load report on ZK, forced or not.
|
void |
writeResourceQuotasToZooKeeper()
Update namespace bundle resource quota on ZK.
|
static final org.slf4j.Logger LOG
static final String LOADBALANCE_BROKERS_ROOT
void start()
throws PulsarServerException
PulsarServerExceptionboolean isCentralized()
Optional<ResourceUnit> getLeastLoaded(org.apache.pulsar.common.naming.ServiceUnitId su) throws Exception
Exceptionorg.apache.pulsar.policies.data.loadbalancer.LoadManagerReport generateLoadReport()
throws Exception
Exceptionvoid setLoadReportForceUpdateFlag()
void writeLoadReportOnZookeeper()
throws Exception
Exceptiondefault void writeLoadReportOnZookeeper(boolean force)
throws Exception
Exceptionvoid writeResourceQuotasToZooKeeper()
throws Exception
ExceptionList<org.apache.pulsar.common.stats.Metrics> getLoadBalancingMetrics()
void doLoadShedding()
void doNamespaceBundleSplit()
throws Exception
Exceptionvoid disableBroker()
throws Exception
ExceptionSet<String> getAvailableBrokers() throws Exception
Exceptionvoid stop() throws PulsarServerException
PulsarServerExceptionvoid initialize(PulsarService pulsar)
pulsar - The service to initialize this with.static LoadManager create(PulsarService pulsar)
Copyright © 2017–2022 Apache Software Foundation. All rights reserved.