org.apache.zookeeper.data.ACL.equals()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(271)

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

ACL.equals介绍

暂无

代码示例

代码示例来源:origin: apache/zookeeper

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (!(o instanceof Create)) return false;
  Create op = (Create) o;
  boolean aclEquals = true;
  Iterator<ACL> i = op.acl.iterator();
  for (ACL acl : op.acl) {
    boolean hasMoreData = i.hasNext();
    if (!hasMoreData) {
      aclEquals = false;
      break;
    }
    ACL otherAcl = i.next();
    if (!acl.equals(otherAcl)) {
      aclEquals = false;
      break;
    }
  }
  return !i.hasNext() && getType() == op.getType() && Arrays.equals(data, op.data) && flags == op.flags && aclEquals;
}

代码示例来源:origin: org.apache.zookeeper/zookeeper

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (!(o instanceof Create)) return false;
  Create op = (Create) o;
  boolean aclEquals = true;
  Iterator<ACL> i = op.acl.iterator();
  for (ACL acl : op.acl) {
    boolean hasMoreData = i.hasNext();
    if (!hasMoreData) {
      aclEquals = false;
      break;
    }
    ACL otherAcl = i.next();
    if (!acl.equals(otherAcl)) {
      aclEquals = false;
      break;
    }
  }
  return !i.hasNext() && getType() == op.getType() && Arrays.equals(data, op.data) && flags == op.flags && aclEquals;
}

代码示例来源:origin: org.apache.hadoop/zookeeper

/**
 * compare two list of acls. if there elements are in the same order and the
 * same size then return true else return false
 *
 * @param lista
 *            the list to be compared
 * @param listb
 *            the list to be compared
 * @return true if and only if the lists are of the same size and the
 *         elements are in the same order in lista and listb
 */
private boolean listACLEquals(List<ACL> lista, List<ACL> listb) {
  if (lista.size() != listb.size()) {
    return false;
  }
  for (int i = 0; i < lista.size(); i++) {
    ACL a = lista.get(i);
    ACL b = listb.get(i);
    if (!a.equals(b)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry

@Test
public void testUGIProperties() throws Throwable {
 UserGroupInformation user = UserGroupInformation.getCurrentUser();
 ACL acl = registrySecurity.createACLForUser(user, ZooDefs.Perms.ALL);
 assertFalse(RegistrySecurity.ALL_READWRITE_ACCESS.equals(acl));
 LOG.info("User {} has ACL {}", user, acl);
}

代码示例来源:origin: io.hops/hadoop-yarn-registry

@Test
public void testUGIProperties() throws Throwable {
 UserGroupInformation user = UserGroupInformation.getCurrentUser();
 ACL acl = registrySecurity.createACLForUser(user, ZooDefs.Perms.ALL);
 assertFalse(RegistrySecurity.ALL_READWRITE_ACCESS.equals(acl));
 LOG.info("User {} has ACL {}", user, acl);
}

相关文章