// Scan root region to find all the meta regions
root = new HRegion(rootTableDir, hlog, fs, conf,
HRegionInfo.ROOT_REGIONINFO, null, null);
InternalScanner rootScanner =
root.getScanner(COL_REGIONINFO_ARRAY, HConstants.EMPTY_START_ROW,
HConstants.LATEST_TIMESTAMP, null);
try {
HStoreKey key = new HStoreKey();
TreeMap<byte [], Cell> results =
new TreeMap<byte [], Cell>(Bytes.BYTES_COMPARATOR);
while(rootScanner.next(key, results)) {
for(Cell c: results.values()) {
HRegionInfo info = Writables.getHRegionInfoOrNull(c.getValue());
if (info != null) {
metaRegions.add(info);
}
}
}
} finally {
rootScanner.close();
try {
root.close();
} catch(IOException e) {
LOG.error(e);