private RegionInfo metaTableConsistencyCheck(Result metaTableRow) {
    RegionInfo ri;
    // Locations comes back null if the RegionInfo field is empty.
    // If locations is null, ensure the regioninfo is for sure empty before progressing.
    // If really empty, report as missing regioninfo! Otherwise, can run server check
    // and get RegionInfo from locations.
    RegionLocations locations = CatalogFamilyFormat.getRegionLocations(metaTableRow);
    if (locations == null) {
      ri = CatalogFamilyFormat.getRegionInfo(metaTableRow, HConstants.REGIONINFO_QUALIFIER);
    } else {
      ri = locations.getDefaultRegionLocation().getRegion();
      checkServer(locations);
    }

    if (ri == null) {
      this.report.emptyRegionInfo.add(metaTableRow.getRow());
      return ri;
    }

    if (!Bytes.equals(metaTableRow.getRow(), ri.getRegionName())) {
      LOG.warn(
        "INCONSISTENCY: Row name is not equal to serialized info:regioninfo content; "
          + "row={} {}; See if RegionInfo is referenced in another hbase:meta row? Delete?",
        Bytes.toStringBinary(metaTableRow.getRow()), ri.getRegionNameAsString());
      return null;
    }
    // Skip split parent region
    if (ri.isSplitParent()) {
      return ri;
    }
    // If table is disabled, skip integrity check.
    if (!isTableDisabled(ri)) {
      if (isTableTransition(ri)) {
        // HBCK1 used to have a special category for missing start or end keys.
        // We'll just lump them in as 'holes'.

        // This is a table transition. If this region is not first region, report a hole.
        if (!ri.isFirst()) {
          addHole(RegionInfoBuilder.UNDEFINED, ri);
        }
        // This is a table transition. If last region was not last region of previous table,
        // report a hole
        if (this.previous != null && !this.previous.isLast()) {
          addHole(this.previous, RegionInfoBuilder.UNDEFINED);
        }
      } else {
        if (!this.previous.isNext(ri)) {
          if (this.previous.isOverlap(ri)) {
            addOverlap(this.previous, ri);
          } else if (ri.isOverlap(this.highestEndKeyRegionInfo)) {
            // We may have seen a region a few rows back that overlaps this one.
            addOverlap(this.highestEndKeyRegionInfo, ri);
          } else if (!this.highestEndKeyRegionInfo.isNext(ri)) {
            // Need to check the case if this.highestEndKeyRegionInfo.isNext(ri). If no,
            // report a hole, otherwise, it is ok. For an example,
            // previous: [aa, bb), ri: [cc, dd), highestEndKeyRegionInfo: [a, cc)
            // In this case, it should not report a hole, as highestEndKeyRegionInfo covers
            // the hole between previous and ri.
            addHole(this.previous, ri);
          }
        } else if (ri.isOverlap(this.highestEndKeyRegionInfo)) {
          // We may have seen a region a few rows back that overlaps this one
          // even though it properly 'follows' the region just before.
          addOverlap(this.highestEndKeyRegionInfo, ri);
        }
      }
      this.previous = ri;
      this.highestEndKeyRegionInfo =
        MetaFixer.getRegionInfoWithLargestEndKey(this.highestEndKeyRegionInfo, ri);
    }
    return ri;
  }
Check row.
@param metaTableRow Row from hbase:meta table.
@return Returns default regioninfo found in row parse as a convenience to save on having to do
        a double-parse of Result.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/janitor/ReportMakingVisitor.java