[
https://issues.apache.org/jira/browse/HBASE-5573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13233721#comment-13233721
]
nkeywal commented on HBASE-5573:
--------------------------------
Patch to get a first feedback.
Unfortunately, it's more a hack than anything else, because I'am trying to keep
the existing code & interface and not rewriting everything.
Today HBase considers any ZK client as a client that will watch the values, and
does not distinguish simple readers vs. watchers. To change this, I:
- Split ZooKeeperWatcher in two classes, one ZooKeeperWatcher with the same
responsibilities as today, and another, ZooKeeperHBaseNodes, that contains the
hbase znode definition. ZooKeeperWatcher extends ZooKeeperHBaseNodes.
- In ZKUtils, depending if a watch is involved or not, changed the expected
type from ZooKeeperWatcher to ZooKeeperHBaseNodes.
That's not a hack yet. The issues are:
- The client is supposed to wait if the root location znode is not yet created
in ZK. I don't think that the trunk implementation actually works. But it's
done with a watcher. As we don't want a watcher, I changed it to a loop.
- As HConnectionImplementation now uses a simple connection and not a Watcher,
the deprecated interface (that returns a ZooKeeperWatcher) cannot reuse the
internal connection to ZK, but must be duplicated.
- In trunk, the current dependencies are:
- RecovableZooKeeper depends(contains) on ZooKeeper
- ZooKeeper depends(contains) on ZooKeeperWatcher
- ZooKeeperWatcher depends(contains) RecovableZooKeeper
- ZKUtils depends(uses) RecovableZooKeeper and ZooKeeperWatcher
That makes it difficult to reuse any part of code without having a
ZooKeeperWatcher. To be able to reuse it, what's happening when using a
ZooKeeperHBaseNodes is that the underlying ZooKeeperWatcher is actually null.
I still have to do a lot of renaming if we go for this approach.
I had some failure that could be unrelated, but I haven't looked at them yet:
org.apache.hadoop.hbase.regionserver.TestSplitTransactionOnCluster
org.apache.hadoop.hbase.io.encoding.TestLoadAndSwitchEncodeOnDisk
> 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
>
> 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