...
Introduction to the Client API
BookKeeper Client API entry point is the org.apache.bookkeeper.client.BookKeeper class.
Usually a Client creates an instance of BookKeeper and uses it to manage several Ledgers using the LedgerHandle API.
Code Block |
---|
try (BookKeeper bookkeeper = BookKeeper.forConfig(new ClientConfiguration()).build();
LedgerHandle ledger = bookkeeper.createLedger(BookKeeper.DigestType.CRC32, "foo".getBytes())) {
ledger.addEntry("bar".getBytes());
} |
BookKeeper Client Builder API
In order to create a BookKeeper client you have to setup a ClientConfiguration object.
The most important parameter is the ZooKeeper connection string, which is needed to access to the BookKeeper ensemble.
(....)
Synch vs Asynch
(explanation of the existance of both a synch API and a asynch API)
...