@Override public boolean exists(String path, boolean watch) throws KeeperException, InterruptedException { try { return watch ? (curator.checkExists().watched().forPath(path) != null) : (curator.checkExists().forPath(path) != null); } catch ( Exception e ) { adjustException(e); } return false; // will never execute }
public boolean existsNode(CuratorFramework zk, String path, boolean watch) throws Exception { Stat stat; if (watch) { stat = zk.checkExists().watched().forPath(PathUtils.normalize_path(path)); } else { stat = zk.checkExists().forPath(PathUtils.normalize_path(path)); } return stat != null; }
public Integer getVersion(CuratorFramework zk, String path, boolean watch) throws Exception { String normPath = PathUtils.normalize_path(path); Stat stat; if (existsNode(zk, normPath, watch)) { if (watch) { stat = zk.checkExists().watched().forPath(PathUtils.normalize_path(path)); } else { stat = zk.checkExists().forPath(PathUtils.normalize_path(path)); } return stat.getVersion(); } return null; }
public boolean exists(String path, boolean watch) throws Exception { Stat stat = watch ? zookeeperClient.checkExists().watched(). forPath(path) : zookeeperClient.checkExists().forPath(path); return stat != null; } }
public boolean exists(String path) throws Exception { Stat stat = zookeeperClient.checkExists().watched().forPath(path); return stat != null; }
public void watch(String path) throws Exception { zookeeperClient.checkExists().watched().forPath(path); }
public boolean existsNode(CuratorFramework zk , String path, boolean watch) throws Exception { Stat stat = null; if (watch) { stat = zk.checkExists().watched().forPath(PathUtils.normalize_path(path)); } else { stat = zk.checkExists().forPath(PathUtils.normalize_path(path)); } return stat != null; }