Hi all,
during the discussion on the patch for the new LedgerAPI there is an
important decision which arose
https://github.com/apache/bookkeeper/pull/510

Should we drop the legacy AsyncCallbacks from the new
WriteHandler/ReadHandler APIs ?

We are introducing CompletableFuture and this is great, but it would be
great to drop legacy callbacks too

Styles of API:
1) long addEntry(data) throws BKException, InterruptedException
2) void asyncAddEntry(data, AddCallback cb, Object ctx)
3) CompletableFuture<Long> asyncAddEntry(data)

the idea is to drop the 2) style of API
Style 1) (sync) is very simple and clear, very good for beginners and for
simple cases
Style 2) would be good but still uses 'legacy' client API package
Style 3) leverages CompletableFuture and it is the new API

a fourth option would be to have a new family of callbacks with a little
overhead due to the introduction of wrappers/adapters
Style 3 can cover uses of 1) but CompletableFuture#get throws
ExecutionException (which will wrap the BKException) and it is not very
user-friendly
Thoughts ?

-- Enrico

2017-09-14 12:54 GMT+02:00 Enrico Olivelli <[EMAIL PROTECTED]>:
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB