ChangeRecord duplicate(long zxid) { StatPersisted stat = new StatPersisted(); if (this.stat != null) { DataTree.copyStatPersisted(this.stat, stat); } return new ChangeRecord(zxid, path, stat, childCount, acl == null ? new ArrayList<ACL>() : new ArrayList<ACL>(acl)); } }
/** * create a /zookeeper/config node for maintaining the configuration (membership and quorum system) info for * zookeeper */ public void addConfigNode() { DataNode zookeeperZnode = nodes.get(procZookeeper); if (zookeeperZnode != null) { // should always be the case zookeeperZnode.addChild(configChildZookeeper); } else { assert false : "There's no /zookeeper znode - this should never happen."; } nodes.put(configZookeeper, new DataNode(new byte[0], -1L, new StatPersisted())); try { // Reconfig node is access controlled by default (ZOOKEEPER-2014). setACL(configZookeeper, ZooDefs.Ids.READ_ACL_UNSAFE, -1); } catch (KeeperException.NoNodeException e) { assert false : "There's no " + configZookeeper + " znode - this should never happen."; } }
@SuppressWarnings("unchecked") ChangeRecord duplicate(long zxid) { StatPersisted stat = new StatPersisted(); if (this.stat != null) { DataTree.copyStatPersisted(this.stat, stat); } return new ChangeRecord(zxid, path, stat, childCount, acl == null ? new ArrayList<ACL>() : new ArrayList<ACL>(acl)); } }
DataNode nodeCopy; synchronized (node) { StatPersisted statCopy = new StatPersisted(); copyStatPersisted(node.stat, statCopy);
synchronized public void deserialize(InputArchive archive, String tag) throws IOException { archive.startRecord("node"); data = archive.readBuffer("data"); acl = archive.readLong("acl"); stat = new StatPersisted(); stat.deserialize(archive, "statpersisted"); archive.endRecord("node"); }
synchronized (node) { scount++; StatPersisted statCopy = new StatPersisted(); copyStatPersisted(node.stat, statCopy);
synchronized public void deserialize(InputArchive archive, String tag) throws IOException { archive.startRecord("node"); data = archive.readBuffer("data"); acl = archive.readLong("acl"); stat = new StatPersisted(); stat.deserialize(archive, "statpersisted"); archive.endRecord("node"); }
String parentName = path.substring(0, lastSlash); String childName = path.substring(lastSlash + 1); StatPersisted stat = new StatPersisted(); stat.setCtime(time); stat.setMtime(time);
String parentName = path.substring(0, lastSlash); String childName = path.substring(lastSlash + 1); StatPersisted stat = new StatPersisted(); stat.setCtime(time); stat.setMtime(time);
/** * 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; }
listACL, createMode.isEphemeral(), newCversion); StatPersisted s = new StatPersisted(); if (createMode.isEphemeral()) { s.setEphemeralOwner(request.sessionId);
newCversion)); StatPersisted s = new StatPersisted(); if (createMode.isEphemeral()) { s.setEphemeralOwner(request.sessionId);
@SuppressWarnings("unchecked") ChangeRecord duplicate(long zxid) { StatPersisted stat = new StatPersisted(); if (this.stat != null) { DataTree.copyStatPersisted(this.stat, stat); } return new ChangeRecord(zxid, path, stat, childCount, acl == null ? new ArrayList<ACL>() : new ArrayList(acl)); } }
synchronized public void deserialize(InputArchive archive, String tag) throws IOException { archive.startRecord("node"); data = archive.readBuffer("data"); acl = archive.readLong("acl"); stat = new StatPersisted(); stat.deserialize(archive, "statpersisted"); archive.endRecord("node"); }
String parentName = path.substring(0, lastSlash); String childName = path.substring(lastSlash + 1); StatPersisted stat = new StatPersisted(); stat.setCtime(time); stat.setMtime(time);
/** * 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; }
createRequest.getAcl(), createMode.isEphemeral()); StatPersisted s = new StatPersisted(); if (createMode.isEphemeral()) { s.setEphemeralOwner(request.sessionId);