DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
Motivation
Currently (in BookKeeper 4.5) we have several overloaded versions of the methods createLedger/createLedegerAdv/asyncCreateLeader/asyncCreateLeaderAdv. This methods are present because from version to version we added new configuration options for the Ledger.
In order to support new features in the future we need to have a more extensible API.
Proposed Change
We can use the Builder design pattern to define a new unified createLedger and asyncCreateLedger API.
...
Existing API will be supported, and maybe it will be deprecated and finally dropped in new major releases (5.0.0)
New or Changed Public Interfaces
We are going to introduce the LedgerConfiguration class which defines the specification for new ledgers.
...
| Code Block |
|---|
public LedgerHandle createLedger(LedgerConfiguration ledgerConfiguration); public void asyncCreateLedger(LedgerConfiguration ledgerConfiguration, CreateCallback callback, Object context); public CompletableFuture<LedgerHandle> asyncCreateLedger(LedgerConfiguration ledgerConfiguration); |
Migration Plan and Compatibility
No issue about migration and compatibility.
Legacy methods will be retained. No @Deprecated annotation will be added. Futher removal of existing APIs will be evaluated in the future, maybe while starting a new major release, like 5.0.0
Rejected Alternatives
An alternative is not to explicitly add a LedgerConfiguration class but to add some builder method to the BookKeper class, like
...