gpt4 book ai didi

org.I0Itec.zkclient.exception.ZkNoNodeException类的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 05:05:31 24 4
gpt4 key购买 nike

本文整理了Java中org.I0Itec.zkclient.exception.ZkNoNodeException类的一些代码示例,展示了ZkNoNodeException类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkNoNodeException类的具体详情如下:
包路径:org.I0Itec.zkclient.exception.ZkNoNodeException
类名称: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);

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com