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:
parent
5f3672b7cf
commit
6bd06665f1
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue