hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r826819 - in /hadoop/hbase/branches/0.20: CHANGES.txt src/java/org/apache/hadoop/hbase/HServerInfo.java
Date Mon, 19 Oct 2009 21:28:04 GMT
Author: jdcryans
Date: Mon Oct 19 21:28:04 2009
New Revision: 826819

URL: http://svn.apache.org/viewvc?rev=826819&view=rev
Log:
HBASE-1918  Don't do DNS resolving in .META. scanner for each row

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=826819&r1=826818&r2=826819&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Mon Oct 19 21:28:04 2009
@@ -16,6 +16,7 @@
   IMPROVEMENTS
    HBASE-1899  Use scanner caching in shell count
    HBASE-1903  Enable DEBUG by default
+   HBASE-1918  Don't do DNS resolving in .META. scanner for each row
 
 Release 0.20.1 - Released October 12th, 2009
   INCOMPATIBLE CHANGES

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java?rev=826819&r1=826818&r2=826819&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java Mon Oct 19
21:28:04 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;
   }



Mime
View raw message