作者热门文章
- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.I0Itec.zkclient.exception.ZkNoNodeException
类的一些代码示例,展示了ZkNoNodeException
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkNoNodeException
类的具体详情如下:
包路径:org.I0Itec.zkclient.exception.ZkNoNodeException
类名称:ZkNoNodeException
暂无
代码示例来源:origin: strimzi/strimzi-kafka-operator
@Override
public Zk delete(String path, int version, Handler<AsyncResult<Void>> handler) {
workerPool().executeBlocking(
future -> {
try {
if (zookeeper.delete(path, version)) {
future.complete();
} else {
future.fail(new ZkNoNodeException());
}
} catch (Throwable t) {
future.fail(t);
}
},
handler);
return this;
}
代码示例来源:origin: com.taobao.metamorphosis/metamorphosis-client
log.warn("maybe other consumer is rebalancing now," + e.getMessage());
return false;
代码示例来源:origin: com.github.sgroschupf/zkclient
@Override
public byte[] readData(String path, Stat stat, boolean watch) throws KeeperException, InterruptedException {
if (watch) {
installWatch(_dataWatches, path);
}
_lock.lock();
try {
byte[] bs = _data.get(path);
if (bs == null) {
throw new ZkNoNodeException(new KeeperException.NoNodeException());
}
return bs;
} finally {
_lock.unlock();
}
}
代码示例来源:origin: ezbz/projectx
@Override
public ZNode createPersistent(final String path) {
final String[] parts = StringUtils.split(path, ZookeeperConstants.PATH_SEPARATOR);
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < parts.length; i++) {
sb.append(ZookeeperConstants.PATH_SEPARATOR).append(parts[i]);
final String pathPart = sb.toString();
if (!zkClient.exists(pathPart)) {
zkClient.createPersistent(pathPart);
final boolean created = zkClient.waitUntilExists(pathPart, TimeUnit.SECONDS,
nodeCreationTimeoutSeconds);
if (!created) {
throw new ZkNoNodeException("Persistent root node not created after "
+ nodeCreationTimeoutSeconds + " seconds, cannot proceed");
}
}
}
return new ZNodeImpl(path);
}
代码示例来源:origin: ezbz/projectx
@Override
public SequentialZNode createEphemeralSequential(final String path, final Object data) {
final String ephermalPath = path + ZookeeperConstants.PATH_SEPARATOR
+ ZookeeperConstants.EPHERMAL_PREFIX;
final String nodeName = zkClient.createEphemeralSequential(ephermalPath, formatData(data));
final boolean created = zkClient.waitUntilExists(nodeName, TimeUnit.SECONDS,
nodeCreationTimeoutSeconds);
if (!created) {
throw new ZkNoNodeException("Ephemeral node not created after " + nodeCreationTimeoutSeconds
+ " seconds, cannot proceed");
}
return createNode(path, nodeName, data);
}
代码示例来源:origin: com.101tec/zkclient
@Override
public byte[] readData(String path, Stat stat, boolean watch) throws KeeperException, InterruptedException {
if (watch) {
installWatch(_dataWatches, path);
}
_lock.lock();
try {
DataAndVersion dataAndVersion = _data.get(path);
if (dataAndVersion == null) {
throw new ZkNoNodeException(new KeeperException.NoNodeException());
}
checkACL(path, ZooDefs.Perms.READ);
byte[] bs = dataAndVersion.getData();
if (stat != null) {
stat.setVersion(dataAndVersion.getVersion());
}
return bs;
} finally {
_lock.unlock();
}
}
代码示例来源:origin: com.github.sgroschupf/zkclient
return new ZkNoNodeException(e);
代码示例来源:origin: com.101tec/zkclient
return new ZkNoNodeException(e);
我是一名优秀的程序员,十分优秀!