gpt4 book ai didi

org.apache.hadoop.hbase.ZooKeeperConnectionException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 17:08:49 30 4
gpt4 key购买 nike

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

ZooKeeperConnectionException.<init>介绍

[英]default constructor
[中]默认构造函数

代码示例

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

private void createBaseZNodes() throws ZooKeeperConnectionException {
 try {
  // Create all the necessary "directories" of znodes
  ZKUtil.createWithParents(this, znodePaths.baseZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.rsZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.drainingZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.tableZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.splitLogZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.backupMasterAddressesZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.tableLockZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.masterMaintZNode);
 } catch (KeeperException e) {
  throw new ZooKeeperConnectionException(
    prefix("Unexpected KeeperException creating base node"), e);
 }
}

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

/**
  * Ensure passed zookeeper is connected.
  * @param timeout Time to wait on established Connection
  */
 public static ZooKeeper ensureConnectedZooKeeper(ZooKeeper zookeeper, int timeout)
   throws ZooKeeperConnectionException {
  if (zookeeper.getState().isConnected()) {
   return zookeeper;
  }
  Stopwatch stopWatch = Stopwatch.createStarted();
  // Make sure we are connected before we hand it back.
  while(!zookeeper.getState().isConnected()) {
   Threads.sleep(1);
   if (stopWatch.elapsed(TimeUnit.MILLISECONDS) > timeout) {
    throw new ZooKeeperConnectionException("Failed connect after waiting " +
      stopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms (zk session timeout); " +
      zookeeper);
   }
  }
  return zookeeper;
 }
}

代码示例来源:origin: org.apache.hbase/hbase-client

/**
  * Ensure passed zookeeper is connected.
  * @param timeout Time to wait on established Connection
  */
 public static ZooKeeper ensureConnectedZooKeeper(ZooKeeper zookeeper, int timeout)
   throws ZooKeeperConnectionException {
  if (zookeeper.getState().isConnected()) {
   return zookeeper;
  }
  Stopwatch stopWatch = Stopwatch.createStarted();
  // Make sure we are connected before we hand it back.
  while(!zookeeper.getState().isConnected()) {
   Threads.sleep(1);
   if (stopWatch.elapsed(TimeUnit.MILLISECONDS) > timeout) {
    throw new ZooKeeperConnectionException("Failed connect after waiting " +
      stopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms (zk session timeout); " +
      zookeeper);
   }
  }
  return zookeeper;
 }
}

代码示例来源:origin: co.cask.hbase/hbase

/**
 * Get the ZooKeeper instance for this TableServers instance.
 *
 * If ZK has not been initialized yet, this will connect to ZK.
 * @returns zookeeper reference
 * @throws ZooKeeperConnectionException if there's a problem connecting to zk
 */
public synchronized ZooKeeperWatcher getZooKeeperWatcher()
  throws ZooKeeperConnectionException {
 if(zooKeeper == null) {
  try {
   this.zooKeeper = new ZooKeeperWatcher(conf, "hconnection", this);
  } catch(ZooKeeperConnectionException zce) {
   throw zce;
  } catch (IOException e) {
   throw new ZooKeeperConnectionException("An error is preventing" +
     " HBase from connecting to ZooKeeper", e);
  }
 }
 return zooKeeper;
}

代码示例来源:origin: harbby/presto-connectors

zkw.getRecoverableZooKeeper().getZooKeeper().exists(zkw.baseZNode, false);
} catch (IOException e) {
 throw new ZooKeeperConnectionException("Can't connect to ZooKeeper", e);
} catch (InterruptedException e) {
 throw (InterruptedIOException)
  new InterruptedIOException("Can't connect to ZooKeeper").initCause(e);
} catch (KeeperException e) {
 throw new ZooKeeperConnectionException("Can't connect to ZooKeeper", e);
} finally {
 if (zkw != null) {

代码示例来源:origin: com.aliyun.hbase/alihbase-client

private void createBaseZNodes() throws ZooKeeperConnectionException {
 try {
  // Create all the necessary "directories" of znodes
  ZKUtil2.createWithParents(this, baseZNode);
  if (conf.getBoolean("hbase.assignment.usezk", true)) {
   ZKUtil2.createAndFailSilent(this, assignmentZNode);
  }
  ZKUtil2.createAndFailSilent(this, rsZNode);
  ZKUtil2.createAndFailSilent(this, drainingZNode);
  ZKUtil2.createAndFailSilent(this, tableZNode);
  ZKUtil2.createAndFailSilent(this, splitLogZNode);
  ZKUtil2.createAndFailSilent(this, backupMasterAddressesZNode);
  ZKUtil2.createAndFailSilent(this, tableLockZNode);
  ZKUtil2.createAndFailSilent(this, recoveringRegionsZNode);
 } catch (KeeperException e) {
  throw new ZooKeeperConnectionException(
    prefix("Unexpected KeeperException creating base node"), e);
 }
}

代码示例来源:origin: harbby/presto-connectors

private void createBaseZNodes() throws ZooKeeperConnectionException {
 try {
  // Create all the necessary "directories" of znodes
  ZKUtil.createWithParents(this, baseZNode);
  if (conf.getBoolean("hbase.assignment.usezk", true)) {
   ZKUtil.createAndFailSilent(this, assignmentZNode);
  }
  ZKUtil.createAndFailSilent(this, rsZNode);
  ZKUtil.createAndFailSilent(this, drainingZNode);
  ZKUtil.createAndFailSilent(this, tableZNode);
  ZKUtil.createAndFailSilent(this, splitLogZNode);
  ZKUtil.createAndFailSilent(this, backupMasterAddressesZNode);
  ZKUtil.createAndFailSilent(this, tableLockZNode);
  ZKUtil.createAndFailSilent(this, recoveringRegionsZNode);
 } catch (KeeperException e) {
  throw new ZooKeeperConnectionException(
    prefix("Unexpected KeeperException creating base node"), e);
 }
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

/**
  * Ensure passed zookeeper is connected.
  * @param timeout Time to wait on established Connection
  */
 public static ZooKeeper ensureConnectedZooKeeper(ZooKeeper zookeeper, int timeout)
   throws ZooKeeperConnectionException {
  if (zookeeper.getState().isConnected()) {
   return zookeeper;
  }
  Stopwatch stopWatch = Stopwatch.createStarted();
  // Make sure we are connected before we hand it back.
  while(!zookeeper.getState().isConnected()) {
   Threads.sleep(1);
   if (stopWatch.elapsed(TimeUnit.MILLISECONDS) > timeout) {
    throw new ZooKeeperConnectionException("Failed connect after waiting " +
      stopWatch.elapsed(TimeUnit.MILLISECONDS) + "ms (zk session timeout); " +
      zookeeper);
   }
  }
  return zookeeper;
 }
}

代码示例来源:origin: org.apache.hbase/hbase-zookeeper

private void createBaseZNodes() throws ZooKeeperConnectionException {
 try {
  // Create all the necessary "directories" of znodes
  ZKUtil.createWithParents(this, znodePaths.baseZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.rsZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.drainingZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.tableZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.splitLogZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.backupMasterAddressesZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.tableLockZNode);
  ZKUtil.createAndFailSilent(this, znodePaths.masterMaintZNode);
 } catch (KeeperException e) {
  throw new ZooKeeperConnectionException(
    prefix("Unexpected KeeperException creating base node"), e);
 }
}

代码示例来源:origin: harbby/presto-connectors

} catch (IOException e) {
 ExceptionUtil.rethrowIfInterrupt(e);
 throw new ZooKeeperConnectionException("Can't connect to ZooKeeper", e);

代码示例来源:origin: co.cask.hbase/hbase

private void createBaseZNodes() throws ZooKeeperConnectionException {
 try {
  // Create all the necessary "directories" of znodes
  ZKUtil.createAndFailSilent(this, baseZNode);
  ZKUtil.createAndFailSilent(this, assignmentZNode);
  ZKUtil.createAndFailSilent(this, rsZNode);
  ZKUtil.createAndFailSilent(this, drainingZNode);
  ZKUtil.createAndFailSilent(this, masterTableZNode);
  ZKUtil.createAndFailSilent(this, masterTableZNode92);
  ZKUtil.createAndFailSilent(this, splitLogZNode);
  ZKUtil.createAndFailSilent(this, backupMasterAddressesZNode);
 } catch (KeeperException e) {
  throw new ZooKeeperConnectionException(
    prefix("Unexpected KeeperException creating base node"), e);
 }
}

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