Interface ManagedLedgerStorage

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Implementing Classes:
    ManagedLedgerClientFactory

    @Private
    @Unstable
    public interface ManagedLedgerStorage
    extends java.lang.AutoCloseable
    Storage to access ManagedLedgers.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Close the storage.
      static ManagedLedgerStorage create​(org.apache.pulsar.broker.ServiceConfiguration conf, org.apache.pulsar.metadata.api.extended.MetadataStoreExtended metadataStore, BookKeeperClientFactory bkProvider, io.netty.channel.EventLoopGroup eventLoopGroup)
      Initialize the ManagedLedgerStorage from the provided resources.
      org.apache.bookkeeper.client.BookKeeper getBookKeeperClient()
      Return the default bookkeeper client.
      org.apache.bookkeeper.mledger.ManagedLedgerFactory getManagedLedgerFactory()
      Return the factory to create ManagedLedgerFactory.
      org.apache.bookkeeper.stats.StatsProvider getStatsProvider()
      Return the stats provider to expose the stats of the storage implementation.
      void initialize​(org.apache.pulsar.broker.ServiceConfiguration conf, org.apache.pulsar.metadata.api.extended.MetadataStoreExtended metadataStore, BookKeeperClientFactory bookkeeperProvider, io.netty.channel.EventLoopGroup eventLoopGroup)
      Initialize the managed ledger storage.
    • Method Detail

      • initialize

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

        org.apache.bookkeeper.mledger.ManagedLedgerFactory getManagedLedgerFactory()
        Return the factory to create ManagedLedgerFactory.
        Returns:
        the factory to create ManagedLedgerFactory.
      • getStatsProvider

        org.apache.bookkeeper.stats.StatsProvider getStatsProvider()
        Return the stats provider to expose the stats of the storage implementation.
        Returns:
        the stats provider.
      • getBookKeeperClient

        org.apache.bookkeeper.client.BookKeeper getBookKeeperClient()
        Return the default bookkeeper client.
        Returns:
        the default bookkeeper client.
      • close

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

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