/** * Return the stat of the node of the given path. Return null if no such a node exists. * <p> * If the watch is true and the call is successful (no exception is thrown), a watch will be left on the node with * the given path. The watch will be triggered by a successful operation that creates/delete the node or sets the * data on the node. * * @param path * the node path * @param watch * whether need to watch this node * @return the stat of the node of the given path; return null if no such a node exists. * @throws KeeperException * If the server signals an error * @throws InterruptedException * If the server transaction is interrupted. */ public Stat exists(final String path, final boolean watch) throws KeeperException, InterruptedException { return retryOperation(new GuaguaZooKeeperOperation<Stat>() { @Override public Stat execute() throws KeeperException, InterruptedException { return getZooKeeper().exists(path, watch); } }); }
/** * Return the stat of the node of the given path. Return null if no such a node exists. * <p> * If the watch is non-null and the call is successful (no exception is thrown), a watch will be left on the node * with the given path. The watch will be triggered by a successful operation that creates/delete the node or sets * the data on the node. * * @param path * the node path * @param watcher * explicit watcher * @return the stat of the node of the given path; return null if no such a * node exists. * @throws KeeperException * If the server signals an error * @throws InterruptedException * If the server transaction is interrupted. * @throws IllegalArgumentException * if an invalid path is specified */ public Stat exists(final String path, final Watcher watcher) throws KeeperException, InterruptedException { return retryOperation(new GuaguaZooKeeperOperation<Stat>() { @Override public Stat execute() throws KeeperException, InterruptedException { return getZooKeeper().exists(path, watcher); } }); }
return retryOperation(new GuaguaZooKeeperOperation<byte[]>() { @Override public byte[] execute() throws KeeperException, InterruptedException {
/** * Return the data and the stat of the node of the given path. * <p> * If the watch is true and the call is successful (no exception is thrown), a watch will be left on the node with * the given path. The watch will be triggered by a successful operation that sets data on the node, or deletes the * node. * <p> * A KeeperException with error code KeeperException.NoNode will be thrown if no node with the given path exists. * * @param path * the given path * @param watch * whether need to watch this node * @param stat * the stat of the node * @return the data of the node * @throws KeeperException * If the server signals an error with a non-zero error code * @throws InterruptedException * If the server transaction is interrupted. */ public byte[] getData(final String path, final boolean watch, final Stat stat) throws KeeperException, InterruptedException { return retryOperation(new GuaguaZooKeeperOperation<byte[]>() { @Override public byte[] execute() throws KeeperException, InterruptedException { return getZooKeeper().getData(path, watch, stat); } }); }
return retryOperation(new GuaguaZooKeeperOperation<List<String>>() { @Override public List<String> execute() throws KeeperException, InterruptedException {
return retryOperation(new GuaguaZooKeeperOperation<List<String>>() { @Override public List<String> execute() throws KeeperException, InterruptedException {
retryOperation(new GuaguaZooKeeperOperation<Void>() { @Override public Void execute() throws KeeperException, InterruptedException {
return retryOperation(new GuaguaZooKeeperOperation<List<String>>() { @Override public List<String> execute() throws KeeperException, InterruptedException {
final boolean recursive) throws KeeperException, InterruptedException { String result = retryOperation(new GuaguaZooKeeperOperation<String>() { @Override public String execute() throws KeeperException, InterruptedException {