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

x33g5p2x  于2022-01-20 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(166)

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

HBaseTestingUtility.waitForHostPort介绍

暂无

代码示例

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

HBaseTestingUtility.waitForHostPort(HConstants.LOCALHOST, port);

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

public void startHBase() throws IOException {
 startDaemonLogTailer();
 cleanupOldState();
 // start ZK
 LOG.info("Starting ZooKeeper on port " + zkClientPort);
 startZK();
 HBaseTestingUtility.waitForHostPort(HConstants.LOCALHOST, zkClientPort);
 for (int masterPort : masterPorts) {
  startMaster(masterPort);
 }
 ZKUtil.waitForBaseZNode(conf);
 for (int rsPort : rsPorts) {
  startRegionServer(rsPort);
 }
 LOG.info("Waiting for HBase startup by scanning META");
 int attemptsLeft = 10;
 while (attemptsLeft-- > 0) {
  try {
   testUtil.getConnection().getTable(TableName.META_TABLE_NAME);
  } catch (Exception e) {
   LOG.info("Waiting for HBase to startup. Retries left: " + attemptsLeft,
     e);
   Threads.sleep(1000);
  }
 }
 LOG.info("Process-based HBase Cluster with " + numRegionServers +
   " region servers up and running... \n\n");
}

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

HBaseTestingUtility.waitForHostPort(HConstants.LOCALHOST, port);

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

public void startHBase() throws IOException {
 startDaemonLogTailer();
 cleanupOldState();
 // start ZK
 LOG.info("Starting ZooKeeper on port " + zkClientPort);
 startZK();
 HBaseTestingUtility.waitForHostPort(HConstants.LOCALHOST, zkClientPort);
 for (int masterPort : masterPorts) {
  startMaster(masterPort);
 }
 ZKUtil.waitForBaseZNode(conf);
 for (int rsPort : rsPorts) {
  startRegionServer(rsPort);
 }
 LOG.info("Waiting for HBase startup by scanning META");
 int attemptsLeft = 10;
 while (attemptsLeft-- > 0) {
  try {
   testUtil.getConnection().getTable(TableName.META_TABLE_NAME);
  } catch (Exception e) {
   LOG.info("Waiting for HBase to startup. Retries left: " + attemptsLeft,
     e);
   Threads.sleep(1000);
  }
 }
 LOG.info("Process-based HBase Cluster with " + numRegionServers +
   " region servers up and running... \n\n");
}

相关文章

HBaseTestingUtility类方法