@Override public String execute() throws KeeperException, InterruptedException { return zk.create(electionPath + "/n_", null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(lockPath, null, CreateMode.PERSISTENT); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(lockPath + "/lock-" + threadId + "-", null, CreateMode.EPHEMERAL_SEQUENTIAL); } });
@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); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(indexerPath, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(zkNodePathBase, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(indexerPath, data, CreateMode.PERSISTENT); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(zkNodePathBase, new byte[0], CreateMode.EPHEMERAL_SEQUENTIAL); } });
@Override public String execute() throws KeeperException, InterruptedException { return zk.create(electionPath + "/n_", null, CreateMode.EPHEMERAL_SEQUENTIAL); } });
@Override public Boolean execute() throws KeeperException, InterruptedException { if (zk.exists(subPath.toString(), false) == null) { try { zk.create(subPath.toString(), newData, CreateMode.PERSISTENT); return true; } catch (KeeperException.NodeExistsException e) { return false; } } return false; } });
@Override public Boolean execute() throws KeeperException, InterruptedException { if (zk.exists(subPath.toString(), false) == null) { try { zk.create(subPath.toString(), newData, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); return true; } catch (KeeperException.NodeExistsException e) { return false; } } return false; } });
public void start() throws IOException, InterruptedException, KeeperException { rpcServer.start(); // Publish our existence in ZooKeeper zkNodePath = hbaseConf.get(SepModel.ZK_ROOT_NODE_CONF_KEY, SepModel.DEFAULT_ZK_ROOT_NODE) + "/" + subscriptionId + "/rs/" + serverName.getServerName(); zk.create(zkNodePath, null, CreateMode.EPHEMERAL); this.running = true; }
public void start() throws IOException, InterruptedException, KeeperException { rpcServer.start(); // Publish our existence in ZooKeeper zkNodePath = hbaseConf.get(SepModel.ZK_ROOT_NODE_CONF_KEY, SepModel.DEFAULT_ZK_ROOT_NODE) + "/" + subscriptionId + "/rs/" + serverName.getServerName(); zk.create(zkNodePath, null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL); this.running = true; }
@Override public Object execute() throws KeeperException, InterruptedException { byte[] data = zk.getData(indexerPath, false, null); String trashPath = indexerTrashPath + "/" + indexerName; // An indexer with the same name might have existed before and hence already exist // in the indexer trash, handle this by appending a sequence number until a unique // name is found. String baseTrashpath = trashPath; int count = 0; while (zk.exists(trashPath, false) != null) { count++; trashPath = baseTrashpath + "." + count; } zk.create(trashPath, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); return null; } });
@Override public Object execute() throws KeeperException, InterruptedException { byte[] data = zk.getData(indexerPath, false, null); String trashPath = indexerTrashPath + "/" + indexerName; // An indexer with the same name might have existed before and hence already exist // in the indexer trash, handle this by appending a sequence number until a unique // name is found. String baseTrashpath = trashPath; int count = 0; while (zk.exists(trashPath, false) != null) { count++; trashPath = baseTrashpath + "." + count; } zk.create(trashPath, data, CreateMode.PERSISTENT); return null; } });