本文整理了Java中org.apache.zookeeper.data.ACL.equals()
方法的一些代码示例,展示了ACL.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ACL.equals()
方法的具体详情如下:
包路径:org.apache.zookeeper.data.ACL
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!