org.apache.helix.manager.zk.zookeeper.ZkClient.getConnection()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中org.apache.helix.manager.zk.zookeeper.ZkClient.getConnection()方法的一些代码示例,展示了ZkClient.getConnection()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClient.getConnection()方法的具体详情如下:
包路径:org.apache.helix.manager.zk.zookeeper.ZkClient
类名称:ZkClient
方法名:getConnection

ZkClient.getConnection介绍

暂无

代码示例

代码示例来源:origin: apache/helix

  1. @Override
  2. public Boolean call() throws Exception {
  3. return getConnection().exists(path, watch);
  4. }
  5. });

代码示例来源:origin: apache/helix

  1. @Override
  2. public Stat call() throws Exception {
  3. Stat stat = ((ZkConnection) getConnection()).getZookeeper().exists(path, false);
  4. return stat;
  5. }
  6. });

代码示例来源:origin: apache/helix

  1. @Override
  2. public String call() throws Exception {
  3. return getConnection().create(path, data, acl, mode);
  4. }
  5. });

代码示例来源:origin: apache/helix

  1. @Override
  2. public List<String> call() throws Exception {
  3. return getConnection().getChildren(path, watch);
  4. }
  5. });

代码示例来源:origin: apache/helix

  1. @Override
  2. public Object call() throws Exception {
  3. getConnection().delete(path);
  4. return null;
  5. }
  6. });

代码示例来源:origin: apache/helix

  1. @Override public Object call() throws Exception {
  2. getConnection().addAuthInfo(scheme, auth);
  3. return null;
  4. }
  5. });

代码示例来源:origin: apache/helix

  1. @Override public Object call() throws Exception {
  2. getConnection().exists(path, true);
  3. return null;
  4. }
  5. });

代码示例来源:origin: apache/helix

  1. @Override public Object call() throws Exception {
  2. return getConnection().writeDataReturnStat(path, data, expectedVersion);
  3. }
  4. });

代码示例来源:origin: apache/helix

  1. @Override public byte[] call() throws Exception {
  2. return getConnection().readData(path, stat, watch);
  3. }
  4. });

代码示例来源:origin: apache/helix

  1. @Override public List<OpResult> call() throws Exception {
  2. return getConnection().multi(ops);
  3. }
  4. });

代码示例来源:origin: apache/helix

  1. @Override public Object call() throws Exception {
  2. ((ZkConnection) getConnection()).getZookeeper().exists(path, null, cb,
  3. new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT, 0, true));
  4. return null;
  5. }
  6. });

代码示例来源:origin: apache/helix

  1. @Override public Object call() throws Exception {
  2. ((ZkConnection) getConnection()).getZookeeper().create(path, data, ZooDefs.Ids.OPEN_ACL_UNSAFE,
  3. // Arrays.asList(DEFAULT_ACL),
  4. mode, cb, new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT,
  5. data == null ? 0 : data.length, false));
  6. return null;
  7. }
  8. });

代码示例来源:origin: apache/helix

  1. @Override public Object call() throws Exception {
  2. ((ZkConnection) getConnection()).getZookeeper().getData(path, null, cb,
  3. new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT, 0, true));
  4. return null;
  5. }
  6. });

代码示例来源:origin: apache/helix

  1. public boolean isConnectionClosed() {
  2. IZkConnection connection = getConnection();
  3. return (connection == null || connection.getZookeeperState() == null ||
  4. !connection.getZookeeperState().isAlive());
  5. }

代码示例来源:origin: apache/helix

  1. @Override public Object call() throws Exception {
  2. ((ZkConnection) getConnection()).getZookeeper().setData(path, data, version, cb,
  3. new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT,
  4. data == null ? 0 : data.length, false));
  5. return null;
  6. }
  7. });

代码示例来源:origin: apache/helix

  1. @Override public Object call() throws Exception {
  2. ((ZkConnection) getConnection()).getZookeeper().delete(path, -1, cb,
  3. new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT, 0, false));
  4. return null;
  5. }
  6. });

代码示例来源:origin: apache/helix

  1. public long getSessionId() {
  2. ZkConnection zkConnection = ((ZkConnection) getConnection());
  3. ZooKeeper zk = zkConnection.getZookeeper();
  4. if (zk == null) {
  5. throw new HelixException(
  6. "ZooKeeper connection information is not available now. ZkClient might be disconnected.");
  7. } else {
  8. return zkConnection.getZookeeper().getSessionId();
  9. }
  10. }

代码示例来源:origin: apache/helix

  1. @Override
  2. public boolean verify() {
  3. return !((ZkClient) manager._zkclient).getConnection().getZookeeperState().isAlive();
  4. }
  5. }, 3000));

代码示例来源:origin: apache/helix

  1. private void reconnect() {
  2. getEventLock().lock();
  3. try {
  4. ZkConnection connection = ((ZkConnection) getConnection());
  5. connection.reconnect(this);
  6. } catch (InterruptedException e) {
  7. throw new ZkInterruptedException(e);
  8. } finally {
  9. getEventLock().unlock();
  10. }
  11. }

代码示例来源:origin: apache/helix

  1. public long getCreationTime(String path) {
  2. acquireEventLock();
  3. try {
  4. return getConnection().getCreateTime(path);
  5. } catch (KeeperException e) {
  6. throw ZkException.create(e);
  7. } catch (InterruptedException e) {
  8. throw new ZkInterruptedException(e);
  9. } finally {
  10. getEventLock().unlock();
  11. }
  12. }

相关文章