use of org.apache.zookeeper_voltpatches.data.ACL in project voltdb by VoltDB.
the class DataTree method serializeList.
private synchronized void serializeList(Map<Long, List<ACL>> longKeyMap, OutputArchive oa) throws IOException {
oa.writeInt(longKeyMap.size(), "map");
Set<Map.Entry<Long, List<ACL>>> set = longKeyMap.entrySet();
for (Map.Entry<Long, List<ACL>> val : set) {
oa.writeLong(val.getKey(), "long");
List<ACL> aclList = val.getValue();
oa.startVector(aclList, "acls");
for (ACL acl : aclList) {
acl.serialize(oa, "acl");
}
oa.endVector(aclList, "acls");
}
}
use of org.apache.zookeeper_voltpatches.data.ACL in project voltdb by VoltDB.
the class DataTree method deserializeList.
private void deserializeList(Map<Long, List<ACL>> longKeyMap, InputArchive ia) throws IOException {
int i = ia.readInt("map");
while (i > 0) {
Long val = ia.readLong("long");
if (aclIndex < val) {
aclIndex = val;
}
List<ACL> aclList = new ArrayList<ACL>();
Index j = ia.startVector("acls");
while (!j.done()) {
ACL acl = new ACL();
acl.deserialize(ia, "acl");
aclList.add(acl);
j.incr();
}
longKeyMap.put(val, aclList);
aclKeyMap.put(aclList, val);
i--;
}
}
use of org.apache.zookeeper_voltpatches.data.ACL in project voltdb by VoltDB.
the class DataTree method listACLEquals.
/**
* 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;
}
Aggregations