public static Put addRegionInfo(final Put p, final RegionInfo hri) throws IOException {
    p.add(CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setRow(p.getRow())
      .setFamily(HConstants.CATALOG_FAMILY).setQualifier(HConstants.REGIONINFO_QUALIFIER)
      .setTimestamp(p.getTimestamp()).setType(Type.Put)
      // Serialize the Default Replica HRI otherwise scan of hbase:meta
      // shows an info:regioninfo value with encoded name and region
      // name that differs from that of the hbase;meta row.
      .setValue(RegionInfo.toByteArray(RegionReplicaUtil.getRegionInfoForDefaultReplica(hri)))
      .build());
    return p;
  }
Updates the location of the specified region to be the specified server.
<p>
Connects to the specified server which should be hosting the specified catalog region name to
perform the edit.
@param connection       connection we're using
@param regionInfo       region to update location of
@param sn               Server name
@param openSeqNum       the latest sequence number obtained when the region was open
@param masterSystemTime wall clock time from master if passed in the open region RPC
@throws IOException In particular could throw {@link java.net.ConnectException} if the server
                    is down on other end.
hbase-server/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java