本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.isBaseZnodeAclSetup()
方法的一些代码示例,展示了ZooKeeperWatcher.isBaseZnodeAclSetup()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperWatcher.isBaseZnodeAclSetup()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher
类名称:ZooKeeperWatcher
方法名:isBaseZnodeAclSetup
[英]Checks whether the ACLs returned from the base znode (/hbase) is set for secure setup.
[中]检查是否将从基本znode(/hbase)返回的ACL设置为安全设置。
代码示例来源:origin: com.aliyun.hbase/alihbase-client
/**
* On master start, we check the znode ACLs under the root directory and set the ACLs properly
* if needed. If the cluster goes from an unsecure setup to a secure setup, this step is needed
* so that the existing znodes created with open permissions are now changed with restrictive
* perms.
*/
public void checkAndSetZNodeAcls() {
if (!ZKUtil2.isSecureZooKeeper(getConfiguration())) {
LOG.info("not a secure deployment, proceeding");
return;
}
// Check the base znodes permission first. Only do the recursion if base znode's perms are not
// correct.
try {
List<ACL> actualAcls = recoverableZooKeeper.getAcl(baseZNode, new Stat());
if (!isBaseZnodeAclSetup(actualAcls)) {
LOG.info("setting znode ACLs");
setZnodeAclsRecursive(baseZNode);
}
} catch(KeeperException.NoNodeException nne) {
return;
} catch(InterruptedException ie) {
interruptedException(ie);
} catch (IOException|KeeperException e) {
LOG.warn("Received exception while checking and setting zookeeper ACLs", e);
}
}
代码示例来源:origin: harbby/presto-connectors
/**
* On master start, we check the znode ACLs under the root directory and set the ACLs properly
* if needed. If the cluster goes from an unsecure setup to a secure setup, this step is needed
* so that the existing znodes created with open permissions are now changed with restrictive
* perms.
*/
public void checkAndSetZNodeAcls() {
if (!ZKUtil.isSecureZooKeeper(getConfiguration())) {
LOG.info("not a secure deployment, proceeding");
return;
}
// Check the base znodes permission first. Only do the recursion if base znode's perms are not
// correct.
try {
List<ACL> actualAcls = recoverableZooKeeper.getAcl(baseZNode, new Stat());
if (!isBaseZnodeAclSetup(actualAcls)) {
LOG.info("setting znode ACLs");
setZnodeAclsRecursive(baseZNode);
}
} catch(KeeperException.NoNodeException nne) {
return;
} catch(InterruptedException ie) {
interruptedException(ie);
} catch (IOException|KeeperException e) {
LOG.warn("Received exception while checking and setting zookeeper ACLs", e);
}
}
内容来源于网络,如有侵权,请联系作者删除!