HBASE-1918 Don't do DNS resolving in .META. scanner for each row

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@826820 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2009-10-19 21:30:02 +00:00
parent a022320ef9
commit 740ad7fff1
2 changed files with 10 additions and 3 deletions

View File

@ -128,6 +128,7 @@ Release 0.21.0 - Unreleased
HBASE-1914 hlog should be able to set replication level for the log HBASE-1914 hlog should be able to set replication level for the log
indendently from any other files indendently from any other files
HBASE-1537 Intra-row scanning HBASE-1537 Intra-row scanning
HBASE-1918 Don't do DNS resolving in .META. scanner for each row
OPTIMIZATIONS OPTIMIZATIONS
HBASE-410 [testing] Speed up the test suite HBASE-410 [testing] Speed up the test suite

View File

@ -73,7 +73,7 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
this.infoPort = other.getInfoPort(); this.infoPort = other.getInfoPort();
this.name = other.getName(); this.name = other.getName();
} }
/** /**
* @return the load * @return the load
*/ */
@ -228,8 +228,14 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
public static String getServerName(String serverAddress, long startCode) { public static String getServerName(String serverAddress, long startCode) {
String name = null; String name = null;
if (serverAddress != null) { if (serverAddress != null) {
HServerAddress address = new HServerAddress(serverAddress); int colonIndex = serverAddress.lastIndexOf(':');
name = getServerName(address.getHostname(), address.getPort(), startCode); if(colonIndex < 0) {
throw new IllegalArgumentException("Not a host:port pair: " + serverAddress);
}
String host = serverAddress.substring(0, colonIndex);
int port =
Integer.valueOf(serverAddress.substring(colonIndex + 1)).intValue();
name = getServerName(host, port, startCode);
} }
return name; return name;
} }