hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1487572 - /hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
Date Wed, 29 May 2013 17:57:26 GMT
Author: tedyu
Date: Wed May 29 17:57:25 2013
New Revision: 1487572

URL: http://svn.apache.org/r1487572
Log:
HBASE-8639 very poor performance of htable#getscanner in multithreaded environment (Ted Yu)


Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java?rev=1487572&r1=1487571&r2=1487572&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
(original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallable.java
Wed May 29 17:57:25 2013
@@ -68,6 +68,14 @@ public class ScannerCallable extends Ser
   private ScanMetrics scanMetrics;
   private boolean logScannerActivity = false;
   private int logCutOffLatency = 1000;
+  private static String myAddress;
+  static {
+    try {
+      myAddress = DNS.getDefaultHost("default", "default");
+    } catch (UnknownHostException uhe) {
+      LOG.error("cannot determine my address", uhe);
+    }
+  }
 
   // indicate if it is a remote server call
   private boolean isRegionServerRemote = true;
@@ -116,10 +124,8 @@ public class ScannerCallable extends Ser
   /**
    * compare the local machine hostname with region server's hostname
    * to decide if hbase client connects to a remote region server
-   * @throws UnknownHostException.
    */
-  private void checkIfRegionServerIsRemote() throws UnknownHostException {
-    String myAddress = DNS.getDefaultHost("default", "default");
+  private void checkIfRegionServerIsRemote() {
     if (this.location.getHostname().equalsIgnoreCase(myAddress)) {
       isRegionServerRemote = false;
     } else {



Mime
View raw message