Bytes.toStringBinary(regionStateA == null ? encodedNameOfRegionA
: encodedNameOfRegionB)));
}
if (!regionStateA.isOpened() || !regionStateB.isOpened()) {
throw new ServiceException(new MergeRegionException(
"Unable to merge regions not online " + regionStateA + ", " + regionStateB));
}
HRegionInfo regionInfoA = regionStateA.getRegion();
HRegionInfo regionInfoB = regionStateB.getRegion();
if (regionInfoA.compareTo(regionInfoB) == 0) {
throw new ServiceException(new MergeRegionException(
"Unable to merge a region to itself " + regionInfoA + ", " + regionInfoB));
}
if (!forcible && !HRegionInfo.areAdjacent(regionInfoA, regionInfoB)) {
throw new ServiceException(new MergeRegionException(
"Unable to merge not adjacent regions "
+ regionInfoA.getRegionNameAsString() + ", "
+ regionInfoB.getRegionNameAsString()
+ " where forcible = " + forcible));
}