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

Mikhail Antonov commented on HBASE-10915:
-----------------------------------------

Regarding the separation, since the handlers are kind of "leaf type of ZK 
usage", I'm doing the separation bottom-up, and we have to manually construct 
such objects full of ZK details, as we have to construct it somewhere.

Perhaps in next Jira I will outline the approach for consensus initialization 
to avoid that. So in this patch I have this:

 - RegionServer creates implementation of CloseRegionConsensus directly, 
instance of CloseRegionDetails impl (so ZK leaks out)
 - creates CloseRegionHandler with them and submits to executor. 

How it needs to be, perhaps:
 - hbase-site.xml has property hbase.consensus.provider(=ZOOKEEPER in our 
current situation).
 - when node starts, it starts service ConsensusNodeServices, which (in our 
case) creates connection to ZK ensemble and keeps the only instance of 
ZooKeeperWatcher (+ set of zk-level listeners)
 - RegionServer class starts,calls ConsensusNodeServices.get() to get impl of 
CloseRegionConsensus, which has reference to ZK watcher (instead of current 
server.getZooKeeper()), and internally tracks the state of relevant znodes.
 - so when RegionServer feels the need to close regions and calls 
closeRegion(region1), it doesn't need to be passed reference to ZK watcher (it 
already has it), and doesn't need to be _passed_ reference to things like znode 
expected versions, because all operations on znodes only ever happen inside the 
CloseRegionConsensus method calls, so it can maintain these data in the data 
structures. 



I will put in more details in the updated doc.


> Decouple CloseRegionHandler from ZooKeeper
> ------------------------------------------
>
>                 Key: HBASE-10915
>                 URL: https://issues.apache.org/jira/browse/HBASE-10915
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Zookeeper
>            Reporter: Mikhail Antonov
>            Assignee: Mikhail Antonov
>         Attachments: HBASE-10915.patch
>
>
> Decouple CloseRegionHandler class from ZK API.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to