Interface ExtensibleLoadManager

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
ExtensibleLoadManagerImpl

public interface ExtensibleLoadManager extends Closeable
Find the appropriate broker for service unit (e.g. bundle) through different load balancer Implementation.
  • Method Details

    • start

      void start() throws PulsarServerException
      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

      void initialize(PulsarService pulsar)
      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

      void close() throws PulsarServerException
      Close the load manager.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      PulsarServerException - if it fails to stop the load manager.