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

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

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

HBaseTestingUtility.waitTableAvailable介绍

[英]Wait until all regions in a table have been assigned. Waits default timeout before giving up (30 seconds).
[中]等待表中的所有区域都已分配。在放弃之前等待默认超时(30秒)。

代码示例

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

/**
 * Wait until all regions in a table have been assigned.  Waits default timeout before giving up
 * (30 seconds).
 * @param table Table to wait on.
 * @throws InterruptedException
 * @throws IOException
 */
public void waitTableAvailable(TableName table)
  throws InterruptedException, IOException {
 waitTableAvailable(table.getName(), 30000);
}

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

@Before
public void setUpBeforeTest() throws IOException, InterruptedException {
 TEST_UTIL.createTable(TABLE_NAME, FAMILY, SPLIT_KEYS);
 TEST_UTIL.waitTableAvailable(TABLE_NAME);
}

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

@Before
public void setUp() throws IOException, InterruptedException {
 tableName = TableName.valueOf(testName.getMethodName().replaceAll("[^0-9a-zA-Z]", "_"));
 UTIL.createTable(tableName, CF);
 UTIL.waitTableAvailable(tableName);
}

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

@Before
public void setup() throws Exception {
 TEST_UTIL.getConfiguration().setInt("hbase.regionserver.logroll.period", logRollPeriod);
 TEST_UTIL.startMiniCluster(1);
 TableName name = TableName.valueOf("Test");
 TEST_UTIL.createTable(name, Bytes.toBytes("cf"));
 TEST_UTIL.waitTableAvailable(name);
}

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

@Before
public void setUp() throws IOException, InterruptedException {
 tableName = TableName.valueOf(name.getMethodName());
 UTIL.createTable(tableName, CF);
 UTIL.waitTableAvailable(tableName);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.getConfiguration().setBoolean(QuotaUtil.QUOTA_CONF_KEY, true);
 TEST_UTIL.getConfiguration().setInt(QuotaCache.REFRESH_CONF_KEY, 2000);
 TEST_UTIL.getConfiguration().setInt("hbase.hstore.compactionThreshold", 10);
 TEST_UTIL.getConfiguration().setInt("hbase.regionserver.msginterval", 100);
 TEST_UTIL.getConfiguration().setInt("hbase.client.pause", 250);
 TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6);
 TEST_UTIL.getConfiguration().setBoolean("hbase.master.enabletable.roundrobin", true);
 TEST_UTIL.startMiniCluster(1);
 TEST_UTIL.waitTableAvailable(QuotaTableUtil.QUOTA_TABLE_NAME);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.getConfiguration().setBoolean(QuotaUtil.QUOTA_CONF_KEY, true);
 TEST_UTIL.getConfiguration().setInt(QuotaCache.REFRESH_CONF_KEY, 2000);
 TEST_UTIL.getConfiguration().setInt("hbase.hstore.compactionThreshold", 10);
 TEST_UTIL.getConfiguration().setInt("hbase.regionserver.msginterval", 100);
 TEST_UTIL.getConfiguration().setInt("hbase.client.pause", 250);
 TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 6);
 TEST_UTIL.getConfiguration().setBoolean("hbase.master.enabletable.roundrobin", true);
 TEST_UTIL.startMiniCluster(1);
 TEST_UTIL.waitTableAvailable(QuotaTableUtil.QUOTA_TABLE_NAME);
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.getConfiguration().setBoolean(QuotaUtil.QUOTA_CONF_KEY, true);
 TEST_UTIL.getConfiguration().setInt(QuotaCache.REFRESH_CONF_KEY, 2000);
 TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_RPC_TIMEOUT_KEY, 60000);
 TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, 120000);
 TEST_UTIL.getConfiguration().setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 2);
 TEST_UTIL.getConfiguration().setInt(START_LOG_ERRORS_AFTER_COUNT_KEY, 0);
 TEST_UTIL.startMiniCluster(1);
 TEST_UTIL.waitTableAvailable(QuotaTableUtil.QUOTA_TABLE_NAME);
 ASYNC_CONN = ConnectionFactory.createAsyncConnection(TEST_UTIL.getConfiguration()).get();
}

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

@BeforeClass
public static void setupCluster() throws Exception {
 UTIL.getConfiguration().set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY,
   MergeRegionObserver.class.getName());
 UTIL.startMiniCluster(3);
 admin = UTIL.getHBaseAdmin();
 byte[][] splitKeys = new byte[1][];
 splitKeys[0] = SPLITKEY;
 UTIL.createTable(TABLE_NAME, CF, splitKeys);
 UTIL.waitTableAvailable(TABLE_NAME);
}

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

@BeforeClass
public static void setUp() throws Exception {
 UTIL.startMiniCluster(3);
 UTIL.createMultiRegionTable(NAME, CF);
 UTIL.waitTableAvailable(NAME);
}

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

@BeforeClass
public static void setUp() throws Exception {
 UTIL.getConfiguration().setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
  DelayCloseCP.class.getName());
 UTIL.startMiniCluster(3);
 UTIL.getAdmin().balancerSwitch(false, true);
 UTIL.createTable(TABLE_NAME, CF);
 UTIL.waitTableAvailable(TABLE_NAME);
}

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

@Test
 public void testIsTableAvailable() throws Exception {
  createTableWithDefaultConf(tableName);
  TEST_UTIL.waitTableAvailable(tableName);
  assertTrue(admin.isTableAvailable(tableName).get());
  assertTrue(admin.isTableAvailable(TableName.META_TABLE_NAME).get());
 }
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
 TEST_UTIL.startMiniCluster(1);
 TEST_UTIL.createTable(TABLE_NAME, FAMILY);
 TEST_UTIL.waitTableAvailable(TABLE_NAME);
 ASYNC_CONN = ConnectionFactory.createAsyncConnection(TEST_UTIL.getConfiguration()).get();
}

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

@BeforeClass
public static void setupCluster() throws Exception {
 UTIL.startMiniCluster(1);
 admin = UTIL.getHBaseAdmin();
 TABLE = UTIL.createTable(TABLE_NAME, CF);
 UTIL.waitTableAvailable(TABLE_NAME);
}

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

@BeforeClass
public static void setupCluster() throws Exception {
 UTIL.startMiniCluster(1);
 admin = UTIL.getHBaseAdmin();
 byte[][] splitKeys = new byte[1][];
 splitKeys[0] = SPLITKEY;
 TABLE = UTIL.createTable(TABLE_NAME, CF, splitKeys);
 UTIL.waitTableAvailable(TABLE_NAME);
}

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

@BeforeClass
public static void setUp() throws Exception {
 UTIL.getConfiguration().setClass(HConstants.MASTER_IMPL, HMasterForTest.class, HMaster.class);
 UTIL.startMiniCluster(1);
 UTIL.createTable(NAME, CF);
 UTIL.waitTableAvailable(NAME);
}

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

@BeforeClass
public static void setUp() throws Exception {
 UTIL.startMiniCluster(3);
 UTIL.getAdmin().balancerSwitch(false, true);
 UTIL.createTable(TABLE_NAME, CF);
 UTIL.waitTableAvailable(TABLE_NAME);
}

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

@Before
public void setUp() throws Exception {
 testUtil.getConfiguration().setInt("hbase.regionserver.msginterval", 30000);
 testUtil.startMiniCluster(2);
 Admin admin = testUtil.getAdmin();
 admin.createNamespace(namespace);
 admin.createTable(TableDescriptorBuilder.newBuilder(tableName)
   .setColumnFamily(ColumnFamilyDescriptorBuilder.of(family)).build());
 testUtil.waitTableAvailable(tableName);
}

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

@BeforeClass
public static void setUp() throws Exception {
 UTIL.startMiniCluster(1);
 UTIL.getAdmin().balancerSwitch(false, true);
 UTIL.createTable(TableDescriptorBuilder.newBuilder(TABLE_NAME)
  .setColumnFamily(ColumnFamilyDescriptorBuilder.of("cf"))
  .setRegionReplication(REGION_REPLICATION).build(), new byte[][] { Bytes.toBytes(0) });
 UTIL.waitTableAvailable(TABLE_NAME);
 HMaster master = UTIL.getMiniHBaseCluster().getMaster();
 ENV = master.getMasterProcedureExecutor().getEnvironment();
 AM = master.getAssignmentManager();
}

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

@BeforeClass
public static void setUp() throws Exception {
 UTIL.getConfiguration().setClass(HConstants.MASTER_IMPL, HMasterForTest.class, HMaster.class);
 UTIL
  .startMiniCluster(StartMiniClusterOption.builder().numMasters(2).numRegionServers(2).build());
 UTIL.createTable(NAME, CF);
 UTIL.waitTableAvailable(NAME);
 UTIL.getAdmin().balancerSwitch(false, true);
}

相关文章

HBaseTestingUtility类方法