public void deserialize(InputArchive archive, String tag) throws IOException { archive.startRecord("node"); data = archive.readBuffer("data"); Index i = archive.startVector("acl"); if (i != null) { acl = new ArrayList<ACL>(); while (!i.done()) { ACL a = new ACL(); a.deserialize(archive, "aclEntry"); acl.add(a); i.incr(); } } archive.endVector("acl"); stat = new StatPersistedV1(); stat.deserialize(archive, "stat"); archive.endRecord("node"); }
DataNodeV1(DataNodeV1 parent, byte data[], List<ACL> acl, StatPersistedV1 stat) { this.parent = parent; this.data = data; this.acl = acl; this.stat = stat; this.children = new HashSet<String>(); }
/** * convert the old stat to new stat * @param oldStat the old stat * @return the new stat */ private StatPersisted convertStat(StatPersistedV1 oldStat) { StatPersisted stat = new StatPersisted(); stat.setAversion(oldStat.getAversion()); stat.setCtime(oldStat.getCtime()); stat.setCversion(oldStat.getCversion()); stat.setCzxid(oldStat.getCzxid()); stat.setEphemeralOwner(oldStat.getEphemeralOwner()); stat.setMtime(oldStat.getMtime()); stat.setMzxid(oldStat.getMzxid()); stat.setVersion(oldStat.getVersion()); return stat; }
static public void copyStatPersisted(StatPersistedV1 from, StatPersistedV1 to) { to.setAversion(from.getAversion()); to.setCtime(from.getCtime()); to.setCversion(from.getCversion()); to.setCzxid(from.getCzxid()); to.setMtime(from.getMtime()); to.setMzxid(from.getMzxid()); to.setVersion(from.getVersion()); to.setEphemeralOwner(from.getEphemeralOwner()); }