What is a good way of checking RegionState?
I am getting the following error when I programmatically try to merge
regions.
Exception in thread "main" java.lang.RuntimeException:
org.apache.hadoop.hbase.exceptions.MergeRegionException:
org.apache.hadoop.hbase.exceptions.MergeRegionException: Unable to merge
regions not online {bc279b84bdfc06496d3fbc2acf12085f state=MERGED,
ts=1403551774320, server=<server-fqdn>,60020,1403551532067},
{c7ff5a85b0c8a82d933e3b826fa4fa2b state=OPEN, ts=1403551554878,
server=<server-fqdn>,60020,1403551532067}
This is intermittent and when I rerun the program, the regions merge
without problem. Sometimes I have to do this several times. I would rather
check the region state and then place a wait for some number of retries.
byte[] regionA =
regionLocations.get(0).getRegionInfo().getEncodedNameAsBytes();
for (int i = 1; i < regionLocations.size(); i++) {
byte[] regionB =
regionLocations.get(i).getRegionInfo().getEncodedNameAsBytes();
admin.mergeRegions(regionA, regionB, true); // HERE - I error
out with state=OPEN problems. How can I check state?
}
Can I check for RegionState somewhere? I am having trouble finding a good
Class to do this with.