[
https://issues.apache.org/jira/browse/BOOKKEEPER-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14051791#comment-14051791
]
Sijie Guo commented on BOOKKEEPER-704:
--------------------------------------
[~ikelly] I don't want to change the zookeeper class reference everywhere in
bookkeeper. So I choose a simple wrapper extending ZooKeeper client interface.
{quote}
In the zookeeper client, you first use the parent instance and then move to a
reconnected instance after expiry. This leads to a lot of code like:
ZooKeeper zkHandle = zk.get();
if (null == zkHandle) {
return ZooKeeperClient.super.getData(path, watch, stat);
}
return zkHandle.getData(path, watch, stat);
I think it would be better to go through a single path for the zkHandle each
time.
{quote}
The code there is that I have to extend ZooKeeper client interface.
{quote}
I also wonder if it wouldn't be worth while just using a preexisting wrapper,
like curator for this. This is complex code, and curator is already well
maintained.
{quote}
I think we basically just need be able to retry zookeeper calls on both
synchronous and asynchronous ways. we actually don't need a lot of frameworks
provided by curator.
And also, I just glanced the Client you provided. I don't know how curator
handles retrying for asynchronous calls and it seems people need to explicitly
call RetryLoop for any zookeeper calls, which means we need to rewrite how
bookkeeper use zookeeper in curator way. This is too big a change.
Based on those concerns, I would prefer a thin wrapper doing this, without
changing a lot of code in bookkeeper.
> reconnectable zookeeper client wrapper
> --------------------------------------
>
> Key: BOOKKEEPER-704
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-704
> Project: Bookkeeper
> Issue Type: Sub-task
> Components: bookkeeper-client, bookkeeper-server
> Reporter: Sijie Guo
> Assignee: Sijie Guo
> Fix For: 4.4.0
>
> Attachments: BOOKKEEPER-704.diff
>
>
> create a reconnectable zookkeeper client wrapper to handle session expire
> event.
--
This message was sent by Atlassian JIRA
(v6.2#6252)