HBASE-4609 ThriftServer.getRegionInfo() is expecting old ServerName format, need to

use new Addressing class instead (Jonathan Gray)


git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1196873 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-11-02 23:48:22 +00:00
parent c61f0f296f
commit 76060691bb
2 changed files with 7 additions and 3 deletions

View File

@ -443,6 +443,8 @@ Release 0.92.0 - Unreleased
HBASE-4713 Raise debug level to warn on ExecutionException in
HConnectionManager$HConnectionImplementation (Lucian George Iordache)
HBASE-4716 Improve locking for single column family bulk load
HBASE-4609 ThriftServer.getRegionInfo() is expecting old ServerName format, need to
use new Addressing class instead (Jonathan Gray)
TESTS
HBASE-4450 test for number of blocks read: to serve as baseline for expected

View File

@ -72,6 +72,7 @@ import org.apache.hadoop.hbase.thrift.generated.TCell;
import org.apache.hadoop.hbase.thrift.generated.TRegionInfo;
import org.apache.hadoop.hbase.thrift.generated.TRowResult;
import org.apache.hadoop.hbase.thrift.generated.TScan;
import org.apache.hadoop.hbase.util.Addressing;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.VersionInfo;
import org.apache.hadoop.hbase.util.Writables;
@ -953,9 +954,10 @@ public class ThriftServer {
value = startRowResult.getValue(HConstants.CATALOG_FAMILY,
HConstants.SERVER_QUALIFIER);
if (value != null && value.length > 0) {
ServerName sn = new ServerName(Bytes.toString(value), -1/*Any value works here for startcode*/);
region.setServerName(Bytes.toBytes(sn.getHostname()));
region.port = sn.getPort();
String hostAndPort = Bytes.toString(value);
region.setServerName(Bytes.toBytes(
Addressing.parseHostname(hostAndPort)));
region.port = Addressing.parsePort(hostAndPort);
}
return region;
} catch (IOException e) {