@Override public HRegionLocation getRegionLocation(final TableName tableName, final byte[] row, boolean reload) throws IOException { return reload ? relocateRegion(tableName, row) : locateRegion(tableName, row); }
@Override public HRegionLocation relocateRegion(final TableName tableName, final byte[] row) throws IOException { RegionLocations locations = relocateRegion(tableName, row, RegionReplicaUtil.DEFAULT_REPLICA_ID); return locations == null ? null : locations.getRegionLocation(RegionReplicaUtil.DEFAULT_REPLICA_ID); }
@Test public void testMetaLookupThreadPoolCreated() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") }; if (TEST_UTIL.getAdmin().tableExists(tableName)) { TEST_UTIL.getAdmin().disableTable(tableName); TEST_UTIL.getAdmin().deleteTable(tableName); } try (Table htable = TEST_UTIL.createTable(tableName, FAMILIES)) { byte[] row = "test".getBytes(); ConnectionImplementation c = ((ConnectionImplementation) TEST_UTIL.getConnection()); // check that metalookup pool would get created c.relocateRegion(tableName, row); ExecutorService ex = c.getCurrentMetaLookupPool(); assert(ex != null); } }
relocateRegion(TableName.META_TABLE_NAME, HConstants.EMPTY_START_ROW, RegionInfo.DEFAULT_REPLICA_ID);
@Override public HRegionLocation getRegionLocation(final TableName tableName, final byte[] row, boolean reload) throws IOException { return reload ? relocateRegion(tableName, row) : locateRegion(tableName, row); }
@Override public HRegionLocation relocateRegion(final TableName tableName, final byte[] row) throws IOException { RegionLocations locations = relocateRegion(tableName, row, RegionReplicaUtil.DEFAULT_REPLICA_ID); return locations == null ? null : locations.getRegionLocation(RegionReplicaUtil.DEFAULT_REPLICA_ID); }
relocateRegion(TableName.META_TABLE_NAME, HConstants.EMPTY_START_ROW, RegionInfo.DEFAULT_REPLICA_ID);
@Override public HRegionLocation getRegionLocation(final TableName tableName, final byte[] row, boolean reload) throws IOException { return reload ? relocateRegion(tableName, row) : locateRegion(tableName, row); }
@Override public HRegionLocation relocateRegion(final TableName tableName, final byte[] row) throws IOException { RegionLocations locations = relocateRegion(tableName, row, RegionReplicaUtil.DEFAULT_REPLICA_ID); return locations == null ? null : locations.getRegionLocation(RegionReplicaUtil.DEFAULT_REPLICA_ID); }
@Test public void testMetaLookupThreadPoolCreated() throws Exception { final TableName tableName = TableName.valueOf(name.getMethodName()); byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") }; if (TEST_UTIL.getAdmin().tableExists(tableName)) { TEST_UTIL.getAdmin().disableTable(tableName); TEST_UTIL.getAdmin().deleteTable(tableName); } try (Table htable = TEST_UTIL.createTable(tableName, FAMILIES);) { byte[] row = "test".getBytes(); ConnectionImplementation c = ((ConnectionImplementation) TEST_UTIL.getConnection()); // check that metalookup pool would get created c.relocateRegion(tableName, row); ExecutorService ex = c.getCurrentMetaLookupPool(); assert(ex != null); } }
relocateRegion(TableName.META_TABLE_NAME, metaStartKey, replicaId);