throw new KeeperException.BadVersionException(path);
int currentVersion = tree.get(path).getRight(); if (version != currentVersion) { throw new KeeperException.BadVersionException(path);
throw new KeeperException.BadVersionException(path); String msg = "Reconfiguration from version " + configId + " failed -- last seen version is " + lzks.self.getLastSeenQuorumVerifier().getVersion(); throw new KeeperException.BadVersionException(msg);
int version = deleteRequest.getVersion(); if (version != -1 && nodeRecord.stat.getVersion() != version) { throw new KeeperException.BadVersionException(path); int currentVersion = nodeRecord.stat.getVersion(); if (version != -1 && version != currentVersion) { throw new KeeperException.BadVersionException(path); currentVersion = nodeRecord.stat.getAversion(); if (version != -1 && version != currentVersion) { throw new KeeperException.BadVersionException(path);
return new NoAuthException(); case BADVERSION: return new BadVersionException(); case NOCHILDRENFOREPHEMERALS: return new NoChildrenForEphemeralsException();
@Override public void setAcl(String path, List<ACL> acl, int version) throws KeeperException, InterruptedException { if (!exists(path, false)) { throw new KeeperException.NoNodeException(); } DataAndVersion dataAndVersion = _data.get(path); if (version != dataAndVersion._version) { throw new KeeperException.BadVersionException(); } checkACL(path, ZooDefs.Perms.ADMIN); _lock.lock(); try { _data.put(path, new DataAndVersion(dataAndVersion.getData(), dataAndVersion.getVersion() + 1, acl)); } finally { _lock.unlock(); } }
public void delete(int expectedVersion) throws KeeperException { assert(!isRoot()); if (!getChildren().isEmpty()) { throw new KeeperException.NotEmptyException(); } if (expectedVersion != -1 && getStat().getVersion() != expectedVersion) { throw new KeeperException.BadVersionException(); } if (getParent().children.remove(getName()) == null) { throw new KeeperException.NoNodeException(); } signalNodeEvent(EventType.NodeDeleted); getParent().signalNodeEvent(EventType.NodeChildrenChanged); }
public void setData(byte[] newData, int expectedVersion) throws KeeperException { if (expectedVersion != -1 && getStat().getVersion() != expectedVersion) { throw new KeeperException.BadVersionException(); } this.data = newData; stat.setDataLength((newData == null) ? 0 : newData.length); stat.setVersion(version.addAndGet(1)); signalNodeEvent(EventType.NodeDataChanged); }
int version = deleteRequest.getVersion(); if (version != -1 && nodeRecord.stat.getVersion() != version) { throw new KeeperException.BadVersionException(path); int currentVersion = nodeRecord.stat.getVersion(); if (version != -1 && version != currentVersion) { throw new KeeperException.BadVersionException(path); currentVersion = nodeRecord.stat.getAversion(); if (version != -1 && version != currentVersion) { throw new KeeperException.BadVersionException(path); currentVersion = nodeRecord.stat.getVersion(); if (version != -1 && version != currentVersion) { throw new KeeperException.BadVersionException(path);
return new NoAuthException(); case BADVERSION: return new BadVersionException(); case NOCHILDRENFOREPHEMERALS: return new NoChildrenForEphemeralsException();
return new NoAuthException(); case BADVERSION: return new BadVersionException(); case NOCHILDRENFOREPHEMERALS: return new NoChildrenForEphemeralsException();
private static int checkAndIncVersion(int currentVersion, int expectedVersion, String path) throws KeeperException.BadVersionException { if (expectedVersion != -1 && expectedVersion != currentVersion) { throw new KeeperException.BadVersionException(path); } return currentVersion + 1; }