public void overwriteRegions(List<RegionInfo> regionInfos, int regionReplication)
    throws IOException {
    // use master time for delete marker and the Put
    long now = EnvironmentEdgeManager.currentTime();
    deleteRegions(regionInfos, now);
    // Why sleep? This is the easiest way to ensure that the previous deletes does not
    // eclipse the following puts, that might happen in the same ts from the server.
    // See HBASE-9906, and HBASE-9879. Once either HBASE-9879, HBASE-8770 is fixed,
    // or HBASE-9905 is fixed and meta uses seqIds, we do not need the sleep.
    //
    // HBASE-13875 uses master timestamp for the mutations. The 20ms sleep is not needed
    MetaTableAccessor.addRegionsToMeta(master.getConnection(), regionInfos, regionReplication,
      now + 1);
    LOG.info("Overwritten " + regionInfos.size() + " regions to Meta");
    LOG.debug("Overwritten regions: {} ", regionInfos);
  }
Overwrites the specified regions from hbase:meta. Deletes old rows for the given regions and
adds new ones. Regions added back have state CLOSED.
@param connection  connection we're using
@param regionInfos list of regions to be added to META
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/RegionStateStore.java