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);
protected boolean processCmd(MyCommandOptions co) throws KeeperException, IOException, InterruptedException { try { return processZKCmd(co); } catch (IllegalArgumentException e) { System.err.println("Command failed: " + e); } catch (KeeperException.NoNodeException e) { System.err.println("Node does not exist: " + e.getPath()); } catch (KeeperException.NoChildrenForEphemeralsException e) { System.err.println("Ephemerals cannot have children: " + e.getPath()); } catch (KeeperException.NodeExistsException e) { System.err.println("Node already exists: " + e.getPath()); } catch (KeeperException.NotEmptyException e) { System.err.println("Node not empty: " + e.getPath()); } catch (KeeperException.NotReadOnlyException e) { System.err.println("Not a read-only call: " + e.getPath()); }catch (KeeperException.InvalidACLException e) { System.err.println("Acl is not valid : "+e.getPath()); }catch (KeeperException.NoAuthException e) { System.err.println("Authentication is not valid : "+e.getPath()); }catch (KeeperException.BadArgumentsException e) { System.err.println("Arguments are not valid : "+e.getPath()); }catch (KeeperException.BadVersionException e) { System.err.println("version No is not valid : "+e.getPath()); } return false; }
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();
return; } catch (KeeperException.BadVersionException e) { log.debug(e.toString(), e); log.warn("Couldn't save aliases due to race with another modification; will update and retry until timeout");
log.warn("[{}] Failed to set permissions for namespace {}: concurrent modification", role, namespaceName); result.completeExceptionally(new IllegalStateException( "Concurrent modification on zk path: " + policiesPath + ", " + e.getMessage())); } catch (Exception e) { log.error("[{}] Failed to get permissions for namespace {}", role, namespaceName, e);
@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();
int currentVersion = tree.get(path).getRight(); if (version != currentVersion) { throw new KeeperException.BadVersionException(path);
throw new KeeperException.BadVersionException(path);
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; }