HBASE-10207 ZKVisibilityLabelWatcher : Populate the labels cache on startup

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1552488 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
anoopsamjohn 2013-12-20 03:34:03 +00:00
parent 5f3672b7cf
commit 6bd06665f1
1 changed files with 12 additions and 2 deletions

View File

@ -59,8 +59,18 @@ public class ZKVisibilityLabelWatcher extends ZooKeeperListener {
public void start() throws KeeperException {
watcher.registerListener(this);
ZKUtil.watchAndCheckExists(watcher, labelZnode);
ZKUtil.watchAndCheckExists(watcher, userAuthsZnode);
if (ZKUtil.watchAndCheckExists(watcher, labelZnode)) {
byte[] data = ZKUtil.getDataAndWatch(watcher, labelZnode);
if (data != null) {
refreshVisibilityLabelsCache(data);
}
}
if (ZKUtil.watchAndCheckExists(watcher, userAuthsZnode)) {
byte[] data = ZKUtil.getDataAndWatch(watcher, userAuthsZnode);
if (data != null) {
refreshUserAuthsCache(data);
}
}
}
private void refreshVisibilityLabelsCache(byte[] data) {