[ 
https://issues.apache.org/jira/browse/HBASE-5573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234254#comment-13234254
 ] 

nkeywal commented on HBASE-5573:
--------------------------------

For ZK and ZKW dependency, prefixing zk for the ZooKeeper api objects and hb 
for the HBase objects:
a zk.ZooKeeper can be created with a zk.Watcher as a parameter for the 
constructor. a hb.ZooKeeperWatcher implements the zk.Watcher interface. So we 
have:

hb.ZooKeeperWatcher implements zk.ZooKeeper.
hb.ZooKeeperWatcher contains hb.RecoverableZooKeeper
hb.RecoverableZooKeeper contains zk.ZooKeeper
zk.ZooKeeper contains (hb.ZooKeeperWatcher implements zk.ZooKeeper)

loop done.

It was like this before my patch. After my patch there are two cases:
1) As above
2) for ZooKeeperHBaseNodes, the watcher is actually "null", so it becomes:
hb.ZooKeeperHBaseNodes contains hb.RecoverableZooKeeper
hb.RecoverableZooKeeper contains zk.ZooKeeper
zk.ZooKeeper contains null

It allows to share the code, but it makes it more complex.


bq. I see. ROZK has a RZK. Can RZK have a ZooKeeper only?
Yes, but it would lead to some code duplication and we would lose the 
recoverable feature (or we would need to duplicate it as well). 


bq. ZooKeeperHBaseNodes => ReadOnlyZooKeeper
It's not really a readonly zookeeper: you can write with it. 


bq. Looks good
Ok, I am gonna finish it with this approach then. 
                
> Replace client ZooKeeper watchers by simple ZooKeeper reads
> -----------------------------------------------------------
>
>                 Key: HBASE-5573
>                 URL: https://issues.apache.org/jira/browse/HBASE-5573
>             Project: HBase
>          Issue Type: Improvement
>          Components: client, zookeeper
>    Affects Versions: 0.96.0
>            Reporter: nkeywal
>            Assignee: nkeywal
>            Priority: Minor
>         Attachments: 5573.v1.patch, 5573.v2.patch
>
>
> Some code in the package needs to read data in ZK. This could be done by a 
> simple read, but is actually implemented with a watcher. This holds ZK 
> resources.
> Fixing this could also be an opportunity to remove the need for the client to 
> provide the master address and port.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to