Interface ManagedLedgerStorage

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
ManagedLedgerClientFactory

@Private @Unstable public interface ManagedLedgerStorage extends AutoCloseable
Storage to access ManagedLedgers.

The interface provides the abstraction to access the storage layer for managed ledgers. The interface supports multiple storage classes, each with its own configuration. The default implementation supports a single instance of BookkeeperManagedLedgerStorageClass. Implementations can provide multiple storage classes. The default storage class is used for topics unless it is overridden by the persistency policy at topic or namespace level.

  • Method Details

    • initialize

      void initialize(ServiceConfiguration conf, org.apache.pulsar.metadata.api.extended.MetadataStoreExtended metadataStore, BookKeeperClientFactory bookkeeperProvider, io.netty.channel.EventLoopGroup eventLoopGroup, io.opentelemetry.api.OpenTelemetry openTelemetry) throws Exception
      Initialize the managed ledger storage.
      Parameters:
      conf - service config
      bookkeeperProvider - bookkeeper provider
      Throws:
      Exception
    • getStorageClasses

      Get all configured storage class instances.
      Returns:
      all configured storage class instances
    • getDefaultStorageClass

      default ManagedLedgerStorageClass getDefaultStorageClass()
      Get the default storage class.
      Returns:
      default storage class
    • getManagedLedgerStorageClass

      Optional<ManagedLedgerStorageClass> getManagedLedgerStorageClass(String name)
      Lookup a storage class by name.
      Parameters:
      name - storage class name
      Returns:
      storage class instance, or empty if not found
    • close

      void close() throws IOException
      Close the storage.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • create

      static ManagedLedgerStorage create(ServiceConfiguration conf, org.apache.pulsar.metadata.api.extended.MetadataStoreExtended metadataStore, BookKeeperClientFactory bkProvider, io.netty.channel.EventLoopGroup eventLoopGroup, io.opentelemetry.api.OpenTelemetry openTelemetry) throws Exception
      Initialize the ManagedLedgerStorage from the provided resources.
      Parameters:
      conf - service config
      bkProvider - bookkeeper client provider
      Returns:
      the initialized managed ledger storage.
      Throws:
      Exception