Interface BookKeeper

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

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

      • 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

        java.util.concurrent.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

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

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