You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jd...@apache.org on 2009/10/19 23:30:02 UTC
svn commit: r826820 - in /hadoop/hbase/trunk: CHANGES.txt
src/java/org/apache/hadoop/hbase/HServerInfo.java
Author: jdcryans
Date: Mon Oct 19 21:30:02 2009
New Revision: 826820
URL: http://svn.apache.org/viewvc?rev=826820&view=rev
Log:
HBASE-1918 Don't do DNS resolving in .META. scanner for each row
Modified:
hadoop/hbase/trunk/CHANGES.txt
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerInfo.java
Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=826820&r1=826819&r2=826820&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Oct 19 21:30:02 2009
@@ -128,6 +128,7 @@
HBASE-1914 hlog should be able to set replication level for the log
indendently from any other files
HBASE-1537 Intra-row scanning
+ HBASE-1918 Don't do DNS resolving in .META. scanner for each row
OPTIMIZATIONS
HBASE-410 [testing] Speed up the test suite
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerInfo.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerInfo.java?rev=826820&r1=826819&r2=826820&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerInfo.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/HServerInfo.java Mon Oct 19 21:30:02 2009
@@ -73,7 +73,7 @@
this.infoPort = other.getInfoPort();
this.name = other.getName();
}
-
+
/**
* @return the load
*/
@@ -228,8 +228,14 @@
public static String getServerName(String serverAddress, long startCode) {
String name = null;
if (serverAddress != null) {
- HServerAddress address = new HServerAddress(serverAddress);
- name = getServerName(address.getHostname(), address.getPort(), startCode);
+ int colonIndex = serverAddress.lastIndexOf(':');
+ 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;
}