DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| Code Block |
|---|
BookKeeper bookeeper = ....;
CompletableFuture<LedgerHandler> future = bookkeeper.createLedger()
.withEnsembleSize(3)
.withWriteQuorumSize(2)
.withAckQuorumSize(1)
.withDigestType(DigestType.CRC32)
.withCustomMetadata(metadata)
.withPassword(password)
.withAdvancedOperations(true|false)
.executeapply();
LedgerHandler lh = future.get();
|
...
| Code Block |
|---|
interface ICreateBuilder {
ICreateBuilder withEnsembleSize(...);
ICreateBuilder withWriteQuorumSize(...);
...
// old style callbacks
void execute(CreateCallback callback, Object ctx);
// support java8 completable future
CompletableFuture<WritableLedgerHandler>CompletableFuture<IWriteHandler> execute();
// sync method
WritableLedgerHandlerIWriteHandler create() throws BKException, InterruptedException;
} |
...
We are going to introduce a WritableLedgerHandler a IWriteHandler interface which contains only the API related to writing to a Ledger.
In a similar way we are going to a ReadableLedegerHandler a IReadHandler which contains only the API related to reading to a Ledger and a IOpenBuilder
| Code Block |
|---|
interface IOpenBuilder {
IOpenBuilder withRecovery(boolean)
IOpenBuilder withPassword(password)
IOpenBuilder withDigestType(digestType)
CompleableFuture<ReadableLedgerHandler>CompleableFuture<IReadHandler> executeapply(long ledgerId)
void open(long ledgerId, OpenCallback cb, Object ctx)
ReadableLedgerHandlerIReadHandler open(long ledgerId)
} |
Migration Plan and Compatibility
...
| Code Block |
|---|
interface ICreateBuilder {
ICreateBuilderAdv withAdvancedOperations()
}
interface ICreateBuilderAdv {
CompletableFuture<AdvancedWritableLedgerHandler> execute();
} |
Maybe AdvancedWritableLedgerHandler AdvancedLedgerHandler should not extend WritableLedgerHandler, because not all the operations on WritableLedgerHandler are available to 'adv' writers, but things will be tricky.
...