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

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

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

HBaseTestingUtility.ensureSomeRegionServersAvailable介绍

[英]Make sure that at least the specified number of region servers are running
[中]确保至少有指定数量的区域服务器正在运行

代码示例

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void setUp() throws Exception {
 if (!secureZKAvailable) {
  return;
 }
 TEST_UTIL.ensureSomeRegionServersAvailable(2);
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before public void setup() throws IOException {
 TEST_UTIL.ensureSomeRegionServersAvailable(2);
}

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

@Before
public void before() throws Exception {
 final int balanceCount = MyMasterObserver.postBalanceCount.get();
 LOG.info("before");
 if (UTIL.ensureSomeRegionServersAvailable(slaves)) {
  // Distribute regions
  UTIL.getMiniHBaseCluster().getMaster().balance();
  // Some plans are created.
  if (MyMasterObserver.postBalanceCount.get() > balanceCount) {
   // It is necessary to wait the move procedure to start.
   // Otherwise, the next wait may pass immediately.
   UTIL.waitFor(3 * 1000, 100, false, () ->
     UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager().hasRegionsInTransition()
   );
  }
  // Wait until completing balance
  UTIL.waitUntilAllRegionsAssigned(TEST_TABLE);
 }
 LOG.info("before done");
}

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

/**
 * Make sure that at least the specified number of region servers
 * are running. We don't count the ones that are currently stopping or are
 * stopped.
 * @param num minimum number of region servers that should be running
 * @return true if we started some servers
 * @throws IOException
 */
public boolean ensureSomeNonStoppedRegionServersAvailable(final int num)
 throws IOException {
 boolean startedServer = ensureSomeRegionServersAvailable(num);
 int nonStoppedServers = 0;
 for (JVMClusterUtil.RegionServerThread rst :
  getMiniHBaseCluster().getRegionServerThreads()) {
  HRegionServer hrs = rst.getRegionServer();
  if (hrs.isStopping() || hrs.isStopped()) {
   LOG.info("A region server is stopped or stopping:"+hrs);
  } else {
   nonStoppedServers++;
  }
 }
 for (int i=nonStoppedServers; i<num; ++i) {
  LOG.info("Started new server=" + getMiniHBaseCluster().startRegionServer());
  startedServer = true;
 }
 return startedServer;
}

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

@Before
public void setup() throws IOException, InterruptedException {
 // Create a table of three families. This will assign a region.
 TEST_UTIL.createTable(TABLENAME, FAMILIES);
 Table t = TEST_UTIL.getConnection().getTable(TABLENAME);
 TEST_UTIL.waitUntilNoRegionsInTransition();
 // Load the table with data for all families
 TEST_UTIL.loadTable(t, FAMILIES);
 TEST_UTIL.flush();
 t.close();
 TEST_UTIL.ensureSomeRegionServersAvailable(2);
}

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

UTIL.ensureSomeRegionServersAvailable(2);
int index = -1;
do {

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

TEST_UTIL.ensureSomeRegionServersAvailable(2);
assertTrue("This test requires WAL file replication set to 2.",
 fs.getDefaultReplication(TEST_UTIL.getDataTestDirOnTestFS()) == 2);

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

@Before
public void setUp() throws Exception {
 if (!secureZKAvailable) {
  return;
 }
 TEST_UTIL.ensureSomeRegionServersAvailable(2);
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void before() throws IOException {
 LOG.info("before");
 UTIL.ensureSomeRegionServersAvailable(1);
 LOG.info("before done");
}

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

@Before
public void setup() throws IOException, InterruptedException {
 // Create a table of three families. This will assign a region.
 TEST_UTIL.createTable(TABLENAME, FAMILIES);
 Table t = TEST_UTIL.getConnection().getTable(TABLENAME);
 TEST_UTIL.waitUntilNoRegionsInTransition();
 // Load the table with data for all families
 TEST_UTIL.loadTable(t, FAMILIES);
 TEST_UTIL.flush();
 t.close();
 TEST_UTIL.ensureSomeRegionServersAvailable(2);
}

相关文章

HBaseTestingUtility类方法