Interface LedgerManager

    • Method Detail

      • writeLedgerMetadata

        java.util.concurrent.CompletableFuture<Versioned<LedgerMetadata>> writeLedgerMetadata​(long ledgerId,
                                                                                              LedgerMetadata metadata,
                                                                                              Version currentVersion)
        Write ledger metadata.
        ledgerId - Ledger Id
        metadata - Ledger Metadata to write
        currentVersion - The version of the metadata we expect to be overwriting.
        Future which, when completed, contains the newly written metadata. Completed with an exception:
      • registerLedgerMetadataListener

        void registerLedgerMetadataListener​(long ledgerId,
                                            BookkeeperInternalCallbacks.LedgerMetadataListener listener)
        Register the ledger metadata listener on ledgerId.
        ledgerId - ledger id.
        listener - listener.
      • unregisterLedgerMetadataListener

        void unregisterLedgerMetadataListener​(long ledgerId,
                                              BookkeeperInternalCallbacks.LedgerMetadataListener listener)
        Unregister the ledger metadata listener on ledgerId.
        ledgerId - ledger id.
        listener - ledger metadata listener.
      • asyncProcessLedgers

        void asyncProcessLedgers​(BookkeeperInternalCallbacks.Processor<java.lang.Long> processor,
                                 org.apache.zookeeper.AsyncCallback.VoidCallback finalCb,
                                 java.lang.Object context,
                                 int successRc,
                                 int failureRc)
        Loop to process all ledgers.

          After all ledgers were processed, finalCb will be triggered:
        • if all ledgers are processed done with OK, success rc will be passed to finalCb.
        • if some ledgers are processed failed, failure rc will be passed to finalCb.

        processor - Ledger Processor to process a specific ledger
        finalCb - Callback triggered after all ledgers are processed
        context - Context of final callback
        successRc - Success RC code passed to finalCb when callback
        failureRc - Failure RC code passed to finalCb when exceptions occurred.
      • getLedgerRanges

        LedgerManager.LedgerRangeIterator getLedgerRanges​(long zkOpTimeOutMs)
        Loop to scan a range of metadata from metadata storage.
        zkOpTimeOutMs - Iterator considers timeout while fetching ledger-range from zk.
        will return a iterator of the Ranges