private long printZnode(DataTree dataTree, String name, boolean dumpData) { System.out.println("----"); DataNode n = dataTree.getNode(name); Set<String> children; long zxid; synchronized (n) { // keep findbugs happy System.out.println(name); printStat(n.stat); zxid = Math.max(n.stat.getMzxid(), n.stat.getPzxid()); if (dumpData) { System.out.println(" data = " + (n.data == null ? "" : Base64.getEncoder().encodeToString(n.data))); } else { System.out.println(" dataLength = " + (n.data == null ? 0 : n.data.length)); } children = n.getChildren(); } if (children != null) { for (String child : children) { long cxid = printZnode( dataTree, name + (name.equals("/") ? "" : "/") + child, dumpData ); zxid = Math.max(zxid, cxid); } } return zxid; }
private void printStat(StatPersisted stat) { printHex("cZxid", stat.getCzxid()); System.out.println(" ctime = " + new Date(stat.getCtime()).toString()); printHex("mZxid", stat.getMzxid()); System.out.println(" mtime = " + new Date(stat.getMtime()).toString()); printHex("pZxid", stat.getPzxid()); System.out.println(" cversion = " + stat.getCversion()); System.out.println(" dataVersion = " + stat.getVersion()); System.out.println(" aclVersion = " + stat.getAversion()); printHex("ephemeralOwner", stat.getEphemeralOwner()); }
private void printStat(StatPersisted stat) { printHex("cZxid", stat.getCzxid()); System.out.println(" ctime = " + new Date(stat.getCtime()).toString()); printHex("mZxid", stat.getMzxid()); System.out.println(" mtime = " + new Date(stat.getMtime()).toString()); printHex("pZxid", stat.getPzxid()); System.out.println(" cversion = " + stat.getCversion()); System.out.println(" dataVersion = " + stat.getVersion()); System.out.println(" aclVersion = " + stat.getAversion()); printHex("ephemeralOwner", stat.getEphemeralOwner()); }
if(!ephemerals.contains(o)) { LOG.info("Restarted follower doesn't contain ephemeral {} zxid 0x{}", o, Long.toHexString(clean.getDataTree().getNode(o).stat.getMzxid())); if(!cleanEphemerals.contains(o)) { LOG.info("Restarted follower has extra ephemeral {} zxid 0x{}", o, Long.toHexString(restarted.getDataTree().getNode(o).stat.getMzxid())); if(!cleanEphemerals.contains(o)) { LOG.info("Follower doesn't contain ephemeral from leader {} zxid 0x{}", o, Long.toHexString(lead.getDataTree().getNode(o).stat.getMzxid())); if(!leadEphemerals.contains(o)) { LOG.info("Leader doesn't contain ephemeral from follower {} zxid 0x{}", o, Long.toHexString(clean.getDataTree().getNode(o).stat.getMzxid()));
synchronized public void copyStat(Stat to) { to.setAversion(stat.getAversion()); to.setCtime(stat.getCtime()); to.setCzxid(stat.getCzxid()); to.setMtime(stat.getMtime()); to.setMzxid(stat.getMzxid()); to.setPzxid(stat.getPzxid()); to.setVersion(stat.getVersion()); to.setEphemeralOwner(getClientEphemeralOwner(stat)); to.setDataLength(data == null ? 0 : data.length); int numChildren = 0; if (this.children != null) { numChildren = children.size(); } // when we do the Cversion we need to translate from the count of the creates // to the count of the changes (v3 semantics) // for every create there is a delete except for the children still present to.setCversion(stat.getCversion()*2 - numChildren); to.setNumChildren(numChildren); }
static public void copyStatPersisted(StatPersisted from, StatPersisted 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.setPzxid(from.getPzxid()); to.setVersion(from.getVersion()); to.setEphemeralOwner(from.getEphemeralOwner()); }
static public void copyStatPersisted(StatPersisted from, StatPersisted 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.setPzxid(from.getPzxid()); to.setVersion(from.getVersion()); to.setEphemeralOwner(from.getEphemeralOwner()); }
synchronized public void copyStat(Stat to) { to.setAversion(stat.getAversion()); to.setCtime(stat.getCtime()); to.setCzxid(stat.getCzxid()); to.setMtime(stat.getMtime()); to.setMzxid(stat.getMzxid()); to.setPzxid(stat.getPzxid()); to.setVersion(stat.getVersion()); to.setEphemeralOwner(stat.getEphemeralOwner()); to.setDataLength(data == null ? 0 : data.length); int numChildren = 0; if (this.children != null) { numChildren = children.size(); } // when we do the Cversion we need to translate from the count of the creates // to the count of the changes (v3 semantics) // for every create there is a delete except for the children still present to.setCversion(stat.getCversion()*2 - numChildren); to.setNumChildren(numChildren); }
watcher.process(new WatchedEvent(EventType.NodeDeleted, KeeperState.SyncConnected, path)); } else if (node.stat.getMzxid() > relativeZxid) { watcher.process(new WatchedEvent(EventType.NodeDataChanged, KeeperState.SyncConnected, path));
watcher.process(new WatchedEvent(EventType.NodeDeleted, KeeperState.SyncConnected, path)); } else if (node.stat.getMzxid() > relativeZxid) { watcher.process(new WatchedEvent(EventType.NodeDataChanged, KeeperState.SyncConnected, path));
sb.append("ctime").append(fieldDelim).append(head.stat.getCtime()).append(fieldSep); sb.append("mtime").append(fieldDelim).append(head.stat.getMtime()).append(fieldSep); sb.append("cmzxid").append(fieldDelim).append("0x" + Long.toHexString(head.stat.getMzxid())) .append(fieldSep); sb.append("pzxid").append(fieldDelim).append("0x" + Long.toHexString(head.stat.getPzxid()))
sb.append("ctime").append(fieldDelim).append(head.stat.getCtime()).append(fieldSep); sb.append("mtime").append(fieldDelim).append(head.stat.getMtime()).append(fieldSep); sb.append("cmzxid").append(fieldDelim).append("0x" + Long.toHexString(head.stat.getMzxid())) .append(fieldSep); sb.append("pzxid").append(fieldDelim).append("0x" + Long.toHexString(head.stat.getPzxid()))
e = new WatchedEvent(EventType.NodeCreated, KeeperState.SyncConnected, path); } else if (node.stat.getMzxid() > relativeZxid) { e = new WatchedEvent(EventType.NodeDataChanged, KeeperState.SyncConnected, path); if (node == null) { } else if (node.stat.getMzxid() > relativeZxid) { e = new WatchedEvent(EventType.NodeDataChanged, KeeperState.SyncConnected, path);
static public void copyStatPersisted(StatPersisted from, StatPersisted 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.setPzxid(from.getPzxid()); to.setVersion(from.getVersion()); to.setEphemeralOwner(from.getEphemeralOwner()); }
synchronized public void copyStat(Stat to) { to.setAversion(stat.getAversion()); to.setCtime(stat.getCtime()); to.setCversion(stat.getCversion()); to.setCzxid(stat.getCzxid()); to.setMtime(stat.getMtime()); to.setMzxid(stat.getMzxid()); to.setPzxid(stat.getPzxid()); to.setVersion(stat.getVersion()); to.setEphemeralOwner(stat.getEphemeralOwner()); to.setDataLength(data == null ? 0 : data.length); if (this.children == null) { to.setNumChildren(0); } else { to.setNumChildren(children.size()); } }