org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.isClientReadable()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(84)

本文整理了Java中org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.isClientReadable()方法的一些代码示例,展示了ZooKeeperWatcher.isClientReadable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperWatcher.isClientReadable()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher
类名称:ZooKeeperWatcher
方法名:isClientReadable

ZooKeeperWatcher.isClientReadable介绍

[英]Returns whether the znode is supposed to be readable by the client and DOES NOT contain sensitive information (world readable).
[中]返回znode是否应该由客户端读取,并且不包含敏感信息(世界可读)。

代码示例

代码示例来源:origin: com.aliyun.hbase/alihbase-client

public static ArrayList<ACL> createACL(ZooKeeperWatcher zkw, String node,
                    boolean isSecureZooKeeper) {
 if (!node.startsWith(zkw.baseZNode)) {
  return Ids.OPEN_ACL_UNSAFE;
 }
 if (isSecureZooKeeper) {
  String superUser = zkw.getConfiguration().get("hbase.superuser");
  ArrayList<ACL> acls = new ArrayList<ACL>();
  // add permission to hbase supper user
  if (superUser != null) {
   acls.add(new ACL(Perms.ALL, new Id("sasl", superUser)));
  }
  // Certain znodes are accessed directly by the client,
  // so they must be readable by non-authenticated clients
  if (zkw.isClientReadable(node)) {
   acls.addAll(Ids.CREATOR_ALL_ACL);
   acls.addAll(Ids.READ_ACL_UNSAFE);
  } else {
   acls.addAll(Ids.CREATOR_ALL_ACL);
  }
  return acls;
 } else {
  return Ids.OPEN_ACL_UNSAFE;
 }
}

代码示例来源:origin: harbby/presto-connectors

if (zkw.isClientReadable(node)) {
 acls.addAll(Ids.CREATOR_ALL_ACL);
 acls.addAll(Ids.READ_ACL_UNSAFE);

相关文章