Description
HBaseAdmin.mergeRegions() calls HBaseAdmin.getRegion() internally. HBaseAdmin.getRegion() requires the full region name. So MetaTableAccessor.getRegion always returns null and this causes one more meta table scan.
Pair<HRegionInfo, ServerName> getRegion(final byte[] regionName) throws IOException { if (regionName == null) { throw new IllegalArgumentException("Pass a table name or region name"); } Pair<HRegionInfo, ServerName> pair = MetaTableAccessor.getRegion(connection, regionName); if (pair == null) {
I suppose to use full region names instead of encoded region names in HBaseAdmin.mergeRegions().