Interface ExtensibleLoadManager
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
ExtensibleLoadManagerImpl
Find the appropriate broker for service unit (e.g. bundle) through different load balancer Implementation.
-
Method Summary
Modifier and TypeMethodDescriptionassign(Optional<org.apache.pulsar.common.naming.ServiceUnitId> topic, org.apache.pulsar.common.naming.ServiceUnitId serviceUnit, LookupOptions options) The incoming service unit (e.g.checkOwnershipAsync(Optional<org.apache.pulsar.common.naming.ServiceUnitId> topic, org.apache.pulsar.common.naming.ServiceUnitId serviceUnit) Check the incoming service unit is owned by the current broker.voidclose()Close the load manager.voidinitialize(PulsarService pulsar) Initialize this load manager using the given pulsar service.voidstart()Start the extensible load manager.
-
Method Details
-
start
Start the extensible load manager. 1. Start the broker registry. 2. Register self to registry. 3. Start the load data store. 4. Init the load manager context. 5. Start load data reporter. 6. Start the namespace unload scheduler. 7. Start the namespace split scheduler. 8. Listen the broker up or down, so we can split immediately.- Throws:
PulsarServerException
-
initialize
Initialize this load manager using the given pulsar service. -
assign
CompletableFuture<Optional<BrokerLookupData>> assign(Optional<org.apache.pulsar.common.naming.ServiceUnitId> topic, org.apache.pulsar.common.naming.ServiceUnitId serviceUnit, LookupOptions options) The incoming service unit (e.g. bundle) selects the appropriate broker through strategies.- Parameters:
topic- The optional topic, some method won't provide topic var in this param (e.g.NamespaceService#internalGetWebServiceUrl(NamespaceBundle, LookupOptions)), So the topic is optional.serviceUnit- service unit (e.g. bundle).options- The lookup options.- Returns:
- The broker lookup data.
-
checkOwnershipAsync
CompletableFuture<Boolean> checkOwnershipAsync(Optional<org.apache.pulsar.common.naming.ServiceUnitId> topic, org.apache.pulsar.common.naming.ServiceUnitId serviceUnit) Check the incoming service unit is owned by the current broker.- Parameters:
topic- The optional topic, some method won't provide topic var in this param.serviceUnit- The service unit (e.g. bundle).- Returns:
- The broker lookup data.
-
close
Close the load manager.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
PulsarServerException- if it fails to stop the load manager.
-