Package org.apache.bookkeeper.client.api
Interface OpenBuilder
-
- All Superinterfaces:
OpBuilder<ReadHandle>
- All Known Implementing Classes:
LedgerOpenOp.OpenBuilderImpl
,OpenBuilderBase
@Public @Unstable public interface OpenBuilder extends OpBuilder<ReadHandle>
Builder-style interface to open exiting ledgers.- Since:
- 4.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OpenBuilder
withDigestType(DigestType digestType)
Sets the expected digest type used to check the contents of the ledger.OpenBuilder
withLedgerId(long ledgerId)
Set the id of the ledger to be opened.OpenBuilder
withPassword(byte[] password)
Sets the password to be used to open the ledger.OpenBuilder
withRecovery(boolean recovery)
Define to open the ledger in recovery mode or in readonly mode.
-
-
-
Method Detail
-
withLedgerId
OpenBuilder withLedgerId(long ledgerId)
Set the id of the ledger to be opened.- Parameters:
ledgerId
-- Returns:
- the builder itself
-
withRecovery
OpenBuilder withRecovery(boolean recovery)
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'- Parameters:
recovery
- recovery mode- Returns:
- the builder itself
-
withPassword
OpenBuilder withPassword(byte[] password)
Sets the password to be used to open the ledger. It defauls to an empty password- Parameters:
password
- the password to unlock the ledger- Returns:
- the builder itself
-
withDigestType
OpenBuilder withDigestType(DigestType digestType)
Sets 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- Parameters:
digestType
- the type of digest- Returns:
- the builder itself
-
-