Interface BookKeeper

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
BookKeeper

@Public @Unstable public interface BookKeeper extends AutoCloseable
This is the entry point for BookKeeper client side API.
Since:
4.6
  • Method Details

    • newBuilder

      static BookKeeperBuilder newBuilder(ClientConfiguration clientConfiguration)
      Create a new builder which can be used to boot a new BookKeeper client.
      Parameters:
      clientConfiguration - the configuration for the client
      Returns:
      a builder
    • newCreateLedgerOp

      CreateBuilder newCreateLedgerOp()
      Start the creation of a new ledger.
      Returns:
      a builder for the new ledger
    • newOpenLedgerOp

      OpenBuilder newOpenLedgerOp()
      Open an existing ledger.
      Returns:
      a builder useful to create a readable handler for an existing ledger
    • newDeleteLedgerOp

      DeleteBuilder newDeleteLedgerOp()
      Delete an existing ledger.
      Returns:
      a builder useful to delete an existing ledger
    • newListLedgersOp

      ListLedgersResultBuilder newListLedgersOp()
      List ledgers.
      Returns:
      a builder useful to list ledgers.
    • getLedgerMetadata

      CompletableFuture<LedgerMetadata> getLedgerMetadata(long ledgerId)
      Get ledger metadata of a given ledger id.
      Parameters:
      ledgerId - id of the ledger.
      Returns:
      a CompletableFuture instance containing ledger metadata.
    • isDriverMetadataServiceAvailable

      CompletableFuture<Boolean> isDriverMetadataServiceAvailable()
      Return driver metadata service is available.
      Returns:
      the metadata service is available.
    • close

      void close() throws BKException, InterruptedException
      Close the client and release every resource.
      Specified by:
      close in interface AutoCloseable
      Throws:
      BKException
      InterruptedException