public static THRegionLocation regionLocationFromHBase(HRegionLocation hrl) {
    RegionInfo hri = hrl.getRegion();
    ServerName serverName = hrl.getServerName();

    THRegionInfo thRegionInfo = new THRegionInfo();
    THRegionLocation thRegionLocation = new THRegionLocation();
    TServerName tServerName = new TServerName();

    tServerName.setHostName(serverName.getHostname());
    tServerName.setPort(serverName.getPort());
    tServerName.setStartCode(serverName.getStartcode());

    thRegionInfo.setTableName(hri.getTable().getName());
    thRegionInfo.setEndKey(hri.getEndKey());
    thRegionInfo.setStartKey(hri.getStartKey());
    thRegionInfo.setOffline(hri.isOffline());
    thRegionInfo.setSplit(hri.isSplit());
    thRegionInfo.setReplicaId(hri.getReplicaId());

    thRegionLocation.setRegionInfo(thRegionInfo);
    thRegionLocation.setServerName(tServerName);

    return thRegionLocation;
  }
Creates a {@link RowMutations} (HBase) from a {@link TRowMutations} (Thrift)
@param in the <code>TRowMutations</code> to convert
@return converted <code>RowMutations</code>
hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java