Class OpenBuilderBase
java.lang.Object
org.apache.bookkeeper.client.impl.OpenBuilderBase
- All Implemented Interfaces:
OpBuilder<ReadHandle>,OpenBuilder
- Direct Known Subclasses:
LedgerOpenOp.OpenBuilderImpl
Base class for open builders which does the mundane builder stuff.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DigestTypeprotected long(package private) static final org.slf4j.Loggerprotected byte[]protected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intvalidate()withDigestType(DigestType digestType) Sets the expected digest type used to check the contents of the ledger.withLedgerId(long ledgerId) Set the id of the ledger to be opened.withPassword(byte[] password) Sets the password to be used to open the ledger.withRecovery(boolean recovery) Define to open the ledger in recovery mode or in readonly mode.
-
Field Details
-
LOG
static final org.slf4j.Logger LOG -
recovery
protected boolean recovery -
ledgerId
protected long ledgerId -
password
protected byte[] password -
digestType
-
-
Constructor Details
-
OpenBuilderBase
public OpenBuilderBase()
-
-
Method Details
-
withLedgerId
Description copied from interface:OpenBuilderSet the id of the ledger to be opened.- Specified by:
withLedgerIdin interfaceOpenBuilder- Returns:
- the builder itself
-
withRecovery
Description copied from interface:OpenBuilderDefine 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:
withRecoveryin interfaceOpenBuilder- Parameters:
recovery- recovery mode- Returns:
- the builder itself
-
withPassword
Description copied from interface:OpenBuilderSets the password to be used to open the ledger. It defaults to an empty password- Specified by:
withPasswordin interfaceOpenBuilder- Parameters:
password- the password to unlock the ledger- Returns:
- the builder itself
-
withDigestType
Description copied from interface:OpenBuilderSets the expected digest type used to check the contents of the ledger. It defaults toDigestType.CRC32. IfClientConfiguration.setEnableDigestTypeAutodetection(boolean)is set to true this value is ignored and the digest type is read directly from metadata- Specified by:
withDigestTypein interfaceOpenBuilder- Parameters:
digestType- the type of digest- Returns:
- the builder itself
-
validate
protected int validate()
-