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

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

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

ZooKeeperHelper.ensureConnectedZooKeeper介绍

[英]Ensure passed zookeeper is connected.
[中]确保已连接合格的动物园管理员。

代码示例

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

public HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain(String[] args)
 throws IOException, InterruptedException {
 super(args);
 // Make sure we are connected before we proceed. Can take a while on some systems. If we
 // run the command without being connected, we get ConnectionLoss KeeperErrorConnection...
 // Make it 30seconds. We dont' have a config in this context and zk doesn't have
 // a timeout until after connection. 30000ms is default for zk.
 ZooKeeperHelper.ensureConnectedZooKeeper(this.zk, 30000);
}

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

/**
 * Get a ZooKeeper instance and wait until it connected before returning.
 * @param sessionTimeoutMs Used as session timeout passed to the created ZooKeeper AND as the
 *   timeout to wait on connection establishment.
 */
public static ZooKeeper getConnectedZooKeeper(String connectString, int sessionTimeoutMs)
  throws IOException {
 ZooKeeper zookeeper = new ZooKeeper(connectString, sessionTimeoutMs, e -> {});
 return ensureConnectedZooKeeper(zookeeper, sessionTimeoutMs);
}

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

/**
 * Get a ZooKeeper instance and wait until it connected before returning.
 * @param sessionTimeoutMs Used as session timeout passed to the created ZooKeeper AND as the
 *   timeout to wait on connection establishment.
 */
public static ZooKeeper getConnectedZooKeeper(String connectString, int sessionTimeoutMs)
  throws IOException {
 ZooKeeper zookeeper = new ZooKeeper(connectString, sessionTimeoutMs, e -> {});
 return ensureConnectedZooKeeper(zookeeper, sessionTimeoutMs);
}

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

public HACK_UNTIL_ZOOKEEPER_1897_ZooKeeperMain(String[] args)
 throws IOException, InterruptedException {
 super(args);
 // Make sure we are connected before we proceed. Can take a while on some systems. If we
 // run the command without being connected, we get ConnectionLoss KeeperErrorConnection...
 // Make it 30seconds. We dont' have a config in this context and zk doesn't have
 // a timeout until after connection. 30000ms is default for zk.
 ZooKeeperHelper.ensureConnectedZooKeeper(this.zk, 30000);
}

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

/**
 * Get a ZooKeeper instance and wait until it connected before returning.
 * @param sessionTimeoutMs Used as session timeout passed to the created ZooKeeper AND as the
 *   timeout to wait on connection establishment.
 */
public static ZooKeeper getConnectedZooKeeper(String connectString, int sessionTimeoutMs)
  throws IOException {
 ZooKeeper zookeeper = new ZooKeeper(connectString, sessionTimeoutMs, e -> {});
 return ensureConnectedZooKeeper(zookeeper, sessionTimeoutMs);
}

相关文章

微信公众号

最新文章

更多