private static void addRegionToMETA(final HRegion meta, final HRegion r) throws IOException {
    // The row key is the region name
    byte[] row = r.getRegionInfo().getRegionName();
    final long now = EnvironmentEdgeManager.currentTime();
    final List<Cell> cells = new ArrayList<>(2);
    cells.add(new KeyValue(row, HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER, now,
      RegionInfo.toByteArray(r.getRegionInfo())));
    // Set into the root table the version of the meta table.
    cells.add(new KeyValue(row, HConstants.CATALOG_FAMILY, HConstants.META_VERSION_QUALIFIER, now,
      Bytes.toBytes(HConstants.META_VERSION)));
    NavigableMap<byte[], List<Cell>> familyMap = new TreeMap<>(Bytes.BYTES_COMPARATOR);
    familyMap.put(HConstants.CATALOG_FAMILY, cells);
    meta.put(new Put(row, HConstants.LATEST_TIMESTAMP, familyMap));
  }
Inserts a new region's meta information into the passed <code>meta</code> region.
@param meta hbase:meta HRegion to be updated
@param r    HRegion to add to <code>meta</code>
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java