use of org.apache.hadoop.hbase.client.RegionReplicaTestHelper.Locator in project hbase by apache.
the class TestAsyncNonMetaRegionLocator method testRegionReplicas.
@Test
public void testRegionReplicas() throws Exception {
TEST_UTIL.getAdmin().createTable(TableDescriptorBuilder.newBuilder(TABLE_NAME).setColumnFamily(ColumnFamilyDescriptorBuilder.of(FAMILY)).setRegionReplication(3).build());
TEST_UTIL.waitUntilAllRegionsAssigned(TABLE_NAME);
testLocator(TEST_UTIL, TABLE_NAME, new Locator() {
@Override
public void updateCachedLocationOnError(HRegionLocation loc, Throwable error) throws Exception {
locator.updateCachedLocationOnError(loc, error);
}
@Override
public RegionLocations getRegionLocations(TableName tableName, int replicaId, boolean reload) throws Exception {
return locator.getRegionLocations(tableName, EMPTY_START_ROW, replicaId, RegionLocateType.CURRENT, reload).get();
}
});
}
Aggregations