Search in sources :

Example 1 with TServerName

use of org.apache.hadoop.hbase.thrift2.generated.TServerName in project hbase by apache.

the class ThriftUtilities method regionLocationFromHBase.

public static THRegionLocation regionLocationFromHBase(HRegionLocation hrl) {
    HRegionInfo hri = hrl.getRegionInfo();
    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;
}
Also used : THRegionInfo(org.apache.hadoop.hbase.thrift2.generated.THRegionInfo) HRegionInfo(org.apache.hadoop.hbase.HRegionInfo) THRegionInfo(org.apache.hadoop.hbase.thrift2.generated.THRegionInfo) THRegionLocation(org.apache.hadoop.hbase.thrift2.generated.THRegionLocation) TServerName(org.apache.hadoop.hbase.thrift2.generated.TServerName) ServerName(org.apache.hadoop.hbase.ServerName) TServerName(org.apache.hadoop.hbase.thrift2.generated.TServerName)

Aggregations

HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)1 ServerName (org.apache.hadoop.hbase.ServerName)1 THRegionInfo (org.apache.hadoop.hbase.thrift2.generated.THRegionInfo)1 THRegionLocation (org.apache.hadoop.hbase.thrift2.generated.THRegionLocation)1 TServerName (org.apache.hadoop.hbase.thrift2.generated.TServerName)1