private Scan getScanForUpdateRegionReplicas(TableName tableName) {
    Scan scan;
    if (TableName.isMetaTableName(tableName)) {
      // Notice that, we do not use MetaCellComparator for master local region, so we can not use
      // the same logic to set start key and end key for scanning meta table when locating entries
      // in master local region. And since there is only one table in master local region(the record
      // for meta table), so we do not need set start key and end key.
      scan = new Scan();
    } else {
      scan = MetaTableAccessor.getScanForTableName(master.getConfiguration(), tableName);
    }
    return scan.addColumn(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER);
  }
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