at http://github.com/thkoch2001/zookeeper/tree/operation_classes you can take
a look at the first try of my team for a new ZooKeeper java client API. I'm
aware of some remaining bugs in the code (watches don't work!), but you can
already see, how the end result should look like.
The changes with their motivation are described in
http://issues.apache.org/jira/browse/ZOOKEEPER-835 and it's sub issues.
- backwards compatibility
- many executors with different changeroots can share one ClientCnxn
- removal of many code duplications. The operation methods inside the
ZooKeeper class now look like:
Create op = new Create(new Path(path), data, acl, createMode);
and for the asynchronous version:
Create op = new Create(new Path(path), null, acl, createMode);
executor.send(op, cb, ctx);
An Executor knows the ClientCnxn and a changeroot.
Our current code is only a very fast implementation so that my team can start
using it. I'll wait for ZOOKEEPER-823 to get committed and afterwards send our
changes in small incremental patches to jira.
We hope we find your approval for our proposal!
Thomas Koch, http://www.koch.ro