public static Put addLocation(Put p, ServerName sn, long openSeqNum, int replicaId)
    throws IOException {
    CellBuilder builder = CellBuilderFactory.create(CellBuilderType.SHALLOW_COPY);
    return p
      .add(builder.clear().setRow(p.getRow()).setFamily(HConstants.CATALOG_FAMILY)
        .setQualifier(CatalogFamilyFormat.getServerColumn(replicaId)).setTimestamp(p.getTimestamp())
        .setType(Cell.Type.Put).setValue(Bytes.toBytes(sn.getAddress().toString())).build())
      .add(builder.clear().setRow(p.getRow()).setFamily(HConstants.CATALOG_FAMILY)
        .setQualifier(CatalogFamilyFormat.getStartCodeColumn(replicaId))
        .setTimestamp(p.getTimestamp()).setType(Cell.Type.Put)
        .setValue(Bytes.toBytes(sn.getStartcode())).build())
      .add(builder.clear().setRow(p.getRow()).setFamily(HConstants.CATALOG_FAMILY)
        .setQualifier(CatalogFamilyFormat.getSeqNumColumn(replicaId)).setTimestamp(p.getTimestamp())
        .setType(Type.Put).setValue(Bytes.toBytes(openSeqNum)).build());
  }
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