@Override public Stat execute() throws KeeperException, InterruptedException { return zk.exists(childPath, false); } });
@Override public Object execute() throws KeeperException, InterruptedException { try { zk.delete(childPath, -1); } catch (KeeperException.NoNodeException e) { // ignore } return null; } });
@Override public List<String> execute() throws KeeperException, InterruptedException { return zk.getChildren(lockPath, null); } }));
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(electionPath + "/n_", null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); } });
public IndexerModelImpl(ZooKeeperItf zk, String zkRoot) throws InterruptedException, KeeperException { this.zk = zk; this.indexerCollectionPath = zkRoot + "/indexer"; this.indexerCollectionPathSlash = indexerCollectionPath + "/"; this.indexerTrashPath = zkRoot + "/indexer-trash"; ZkUtil.createPath(zk, indexerCollectionPath); ZkUtil.createPath(zk, indexerTrashPath); zk.addDefaultWatcher(connectStateWatcher); indexerCacheRefresher.start(); indexerCacheRefresher.waitUntilStarted(); }
@Override public Boolean execute() throws KeeperException, InterruptedException { zk.setData(path, data, version); return null; } });
@Override public Stat execute() throws KeeperException, InterruptedException { return zk.exists(lockPath, null); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(lockPath, null, CreateMode.PERSISTENT); } });
@Override public Object execute() throws KeeperException, InterruptedException { zk.delete(lockId, -1); return null; } });
@Override public List<String> execute() throws KeeperException, InterruptedException { return zk.getChildren(lockPath, null); } });
@Override public Boolean execute() throws KeeperException, InterruptedException { return zk.exists(zkRoot, false) != null; } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(indexerPath, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } });
@Override public Integer execute() throws KeeperException, InterruptedException { zk.delete(indexerProcessId, -1); return 0; } });
@Override public List<String> execute() throws KeeperException, InterruptedException { return zk.getChildren(lockPath, null); } }));
@Override public Stat execute() throws KeeperException, InterruptedException { return zk.exists(pathToWatch, watcher); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(zkNodePathBase, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); } });
@Override public Object execute() throws KeeperException, InterruptedException { try { zk.delete(childPath, -1); } catch (KeeperException.NoNodeException e) { // ignore } return null; } });
@Override public Stat execute() throws KeeperException, InterruptedException { return zk.exists(pathToWatch, watcher); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(lockPath, null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(lockPath + "/lock-" + threadId + "-", null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); } });