as iwinit dug in source codes[1],the 'regions assigment' in hbase is complex and trickle.there are many of zk related events across master and rs,and huge of pre-post processes in it.
below is a abstract view i figured out:
against zookeeper,u will find the many of interesting processing models like these:
a.A creates znodes in zk with raw state;
b.B does some processes that it should expect;then update the state ;
c.A receives that events,then finalize the znode and post-business
last,i wonder to declare that some important zk related events across this assignment:
also,below is the zookeeper events trigger basics:
that means there is a 3-d trigger model:
EventType | tirgger creation point(register) | trigger event(operation) | usage |
NodeCreated |
exists | create a znode | |
NodeDeleted |
exists,getData, getChildren(this is the case of deletion of parent znode) |
delete a znode | |
NodeDataChanged |
exists,getData | update/set a znode with new/old data | |
NodeChildrenChanged |
getChildren | create/delete a child znode |
in other words,by simplely,u can:
make a 'trigger operation' -> then through previously 'register' -> then get a appropriate callback 'EventType'
but one thing i have no idea is which register will be triggered first when updating a znode if i use both 'exists' and 'getData' register on the same znode?
i this there will be some rules to do this in zk.so i will check for the source also soon later ...TODO
ref:
hadoop-guide