本文整理了Java中com.indeed.util.zookeeper.ZooKeeperConnection.createFullPath()
方法的一些代码示例,展示了ZooKeeperConnection.createFullPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperConnection.createFullPath()
方法的具体详情如下:
包路径:com.indeed.util.zookeeper.ZooKeeperConnection
类名称:ZooKeeperConnection
方法名:createFullPath
暂无
代码示例来源:origin: indeedeng/util
public static void createFullPath(ZooKeeperConnection zooKeeperConnection, String path, byte[] value, CreateMode createMode)
throws InterruptedException, KeeperException {
createFullPath(zooKeeperConnection, path, value, createMode, false);
}
代码示例来源:origin: indeedeng/util
public boolean createFullPath(String path, byte[] value, CreateMode createMode, boolean ignoreIfExists) throws KeeperException, InterruptedException {
return createFullPath(this, path, value, createMode, ignoreIfExists);
}
代码示例来源:origin: indeedeng/util
public void createFullPath(String path, byte[] value, CreateMode createMode) throws KeeperException, InterruptedException {
createFullPath(this, path, value, createMode);
}
代码示例来源:origin: indeedeng/util
public static void updateOrCreate(ZooKeeperConnection zooKeeper, String path, byte[] value, CreateMode createMode)
throws InterruptedException, KeeperException {
boolean success = false;
if (zooKeeper.exists(path, false) == null) {
success = createFullPath(zooKeeper, path, value, createMode, true);
}
if (!success) zooKeeper.setData(path, value, -1);
}
代码示例来源:origin: indeedeng/imhotep
private void createNode() {
boolean created = false;
while (!created) {
try {
try {
zkConnection.connect();
ZooKeeperConnection.createFullPath(zkConnection, rootPath, new byte[0], CreateMode.PERSISTENT, true);
zkConnection.create(rootPath + "/"+nodeName, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL);
created = true;
} catch (IOException e) {
log.error(e);
Thread.sleep(TIMEOUT);
} catch (KeeperException e) {
log.error(e);
zkConnection.close();
Thread.sleep(TIMEOUT);
}
} catch (InterruptedException e) {
log.error(e);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!