private boolean recordMetaRegion() throws IOException {
    List<HRegionLocation> locs;
    try (RegionLocator locator = connection.getRegionLocator(TableName.META_TABLE_NAME)) {
      locs = locator.getRegionLocations(HConstants.EMPTY_START_ROW, true);
    }
    if (locs == null || locs.isEmpty()) {
      errors.reportError(ERROR_CODE.NULL_META_REGION, "META region was not found in ZooKeeper");
      return false;
    }
    for (HRegionLocation metaLocation : locs) {
      // Check if Meta region is valid and existing
      if (metaLocation == null) {
        errors.reportError(ERROR_CODE.NULL_META_REGION, "META region location is null");
        return false;
      }
      if (metaLocation.getRegion() == null) {
        errors.reportError(ERROR_CODE.NULL_META_REGION, "META location regionInfo is null");
        return false;
      }
      if (metaLocation.getHostname() == null) {
        errors.reportError(ERROR_CODE.NULL_META_REGION, "META location hostName is null");
        return false;
      }
      ServerName sn = metaLocation.getServerName();
      HbckRegionInfo.MetaEntry m = new HbckRegionInfo.MetaEntry(metaLocation.getRegion(), sn,
        EnvironmentEdgeManager.currentTime());
      HbckRegionInfo hbckRegionInfo = regionInfoMap.get(metaLocation.getRegion().getEncodedName());
      if (hbckRegionInfo == null) {
        regionInfoMap.put(metaLocation.getRegion().getEncodedName(), new HbckRegionInfo(m));
      } else {
        hbckRegionInfo.setMetaEntry(m);
      }
    }
    return true;
  }
Record the location of the hbase:meta region as found in ZooKeeper.
hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java