@Nullable
  public static ServerName getTargetServerName(final Result r, final int replicaId) {
    final Cell cell = r.getColumnLatestCell(HConstants.CATALOG_FAMILY,
      CatalogFamilyFormat.getServerNameColumn(replicaId));
    if (cell == null || cell.getValueLength() == 0) {
      RegionLocations locations = CatalogFamilyFormat.getRegionLocations(r);
      if (locations != null) {
        HRegionLocation location = locations.getRegionLocation(replicaId);
        if (location != null) {
          return location.getServerName();
        }
      }
      return null;
    }
    return ServerName.parseServerName(
      Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()));
  }
Returns the {@link ServerName} from catalog table {@link Result} where the region is
transitioning on. It should be the same as
{@link CatalogFamilyFormat#getServerName(Result,int)} if the server is at OPEN state.
@param r Result to pull the transitioning server name from
@return A ServerName instance or {@link CatalogFamilyFormat#getServerName(Result,int)} if
        necessary fields not found or empty.
hbase-server/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java