Package org.apache.bookkeeper.client.api
Interface CreateBuilder
-
- All Superinterfaces:
OpBuilder<WriteHandle>
- All Known Implementing Classes:
LedgerCreateOp.CreateBuilderImpl
@Public @Unstable public interface CreateBuilder extends OpBuilder<WriteHandle>
Builder-style interface to create new ledgers.- Since:
- 4.6
- See Also:
BookKeeper.newCreateLedgerOp()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CreateAdvBuilder
makeAdv()
Switch the ledger into 'Advanced' mode.CreateBuilder
withAckQuorumSize(int ackQuorumSize)
Set the number of acknowledgements to wait before considering a write to be completed with success.CreateBuilder
withCustomMetadata(java.util.Map<java.lang.String,byte[]> customMetadata)
Set a map a custom data to be attached to the ledger.CreateBuilder
withDigestType(DigestType digestType)
Set the Digest type used to guard data against corruption.CreateBuilder
withEnsembleSize(int ensembleSize)
Set the number of bookies which will receive data for this ledger.CreateBuilder
withPassword(byte[] password)
Set a password for the ledger.CreateBuilder
withWriteFlags(java.util.EnumSet<WriteFlag> writeFlags)
Set write flags.default CreateBuilder
withWriteFlags(WriteFlag... writeFlags)
Set write flags.CreateBuilder
withWriteQuorumSize(int writeQuorumSize)
Set the number of bookies which receive every single entry.
-
-
-
Method Detail
-
withEnsembleSize
CreateBuilder withEnsembleSize(int ensembleSize)
Set the number of bookies which will receive data for this ledger. It defaults to 3.- Parameters:
ensembleSize
- the number of bookies- Returns:
- the builder itself
-
withWriteQuorumSize
CreateBuilder withWriteQuorumSize(int writeQuorumSize)
Set the number of bookies which receive every single entry. In case of ensembleSize > writeQuorumSize data will be striped across a number of ensembleSize bookies. It defaults to 2.- Parameters:
writeQuorumSize
- the replication factor for each entry- Returns:
- the builder itself
-
withAckQuorumSize
CreateBuilder withAckQuorumSize(int ackQuorumSize)
Set the number of acknowledgements to wait before considering a write to be completed with success. This value can be less or equals to writeQuorumSize. It defaults to 2.- Parameters:
ackQuorumSize
- the number of acknowledgements to wait for- Returns:
- the builder itself
-
withPassword
CreateBuilder withPassword(byte[] password)
Set a password for the ledger. It defaults to empty password- Parameters:
password
- the password- Returns:
- the builder itself
-
withWriteFlags
CreateBuilder withWriteFlags(java.util.EnumSet<WriteFlag> writeFlags)
Set write flags. Write flags specify the behaviour of writes- Parameters:
writeFlags
- the flags- Returns:
- the builder itself
-
withWriteFlags
default CreateBuilder withWriteFlags(WriteFlag... writeFlags)
Set write flags. Write flags specify the behaviour of writes- Parameters:
writeFlags
- the flags- Returns:
- the builder itself
-
withCustomMetadata
CreateBuilder withCustomMetadata(java.util.Map<java.lang.String,byte[]> customMetadata)
Set a map a custom data to be attached to the ledger. The application is responsible for the semantics of these data.- Parameters:
customMetadata
- the ledger metadata- Returns:
- the builder itself
-
withDigestType
CreateBuilder withDigestType(DigestType digestType)
Set the Digest type used to guard data against corruption. It defaults toDigestType.CRC32
- Parameters:
digestType
- the type of digest- Returns:
- the builder itself
-
makeAdv
CreateAdvBuilder makeAdv()
Switch the ledger into 'Advanced' mode. A ledger used in Advanced mode will explicitly generate the sequence of entry identifiers. Advanced ledgers can be created with a client side defined ledgerId- Returns:
- a new
CreateAdvBuilder
builder
-
-