Class OpenBuilderBase

java.lang.Object
org.apache.bookkeeper.client.impl.OpenBuilderBase
All Implemented Interfaces:
OpBuilder<ReadHandle>, OpenBuilder
Direct Known Subclasses:
LedgerOpenOp.OpenBuilderImpl

public abstract class OpenBuilderBase extends Object implements OpenBuilder
Base class for open builders which does the mundane builder stuff.
  • Field Details

    • LOG

      static final org.slf4j.Logger LOG
    • recovery

      protected boolean recovery
    • ledgerId

      protected long ledgerId
    • password

      protected byte[] password
    • digestType

      protected DigestType digestType
  • Constructor Details

    • OpenBuilderBase

      public OpenBuilderBase()
  • Method Details

    • withLedgerId

      public OpenBuilder withLedgerId(long ledgerId)
      Description copied from interface: OpenBuilder
      Set the id of the ledger to be opened.
      Specified by:
      withLedgerId in interface OpenBuilder
      Returns:
      the builder itself
    • withRecovery

      public OpenBuilder withRecovery(boolean recovery)
      Description copied from interface: OpenBuilder
      Define to open the ledger in recovery mode or in readonly mode. In recovery mode the ledger will be fenced and the writer of the ledger will be prevented from issuing other writes to the ledger. It defaults to 'false'
      Specified by:
      withRecovery in interface OpenBuilder
      Parameters:
      recovery - recovery mode
      Returns:
      the builder itself
    • withPassword

      public OpenBuilder withPassword(byte[] password)
      Description copied from interface: OpenBuilder
      Sets the password to be used to open the ledger. It defaults to an empty password
      Specified by:
      withPassword in interface OpenBuilder
      Parameters:
      password - the password to unlock the ledger
      Returns:
      the builder itself
    • withDigestType

      public OpenBuilder withDigestType(DigestType digestType)
      Description copied from interface: OpenBuilder
      Sets the expected digest type used to check the contents of the ledger. It defaults to DigestType.CRC32. If ClientConfiguration.setEnableDigestTypeAutodetection(boolean) is set to true this value is ignored and the digest type is read directly from metadata
      Specified by:
      withDigestType in interface OpenBuilder
      Parameters:
      digestType - the type of digest
      Returns:
      the builder itself
    • validate

      protected int validate()