hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bryanduxb...@apache.org
Subject svn commit: r637474 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/client/HTable.java
Date Sat, 15 Mar 2008 21:15:51 GMT
Author: bryanduxbury
Date: Sat Mar 15 14:15:45 2008
New Revision: 637474

URL: http://svn.apache.org/viewvc?rev=637474&view=rev
Log:
HBASE-506 When an exception has to escape ServerCallable due to exhausted retries, show all
the exceptions that lead to this situation
-Updated ServerCallable to track a list of exceptions and report them all when the process
runs out of retries

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=637474&r1=637473&r2=637474&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Sat Mar 15 14:15:45 2008
@@ -6,6 +6,8 @@
 
   NEW FEATURES
    HBASE-40    Add a method of getting multiple (but not all) cells for a row at once
+   HBASE-506   When an exception has to escape ServerCallable due to exhausted retries, 
+               show all the exceptions that lead to this situation
    
   OPTIMIZATIONS
    HBASE-430   Performance: Scanners and getRow return maps with duplicate data

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java?rev=637474&r1=637473&r2=637474&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HTable.java Sat Mar 15 14:15:45
2008
@@ -1036,6 +1036,7 @@
    */
   protected <T> T getRegionServerWithRetries(ServerCallable<T> callable) 
   throws IOException, RuntimeException {
+    List<IOException> exceptions = new ArrayList<IOException>();
     for(int tries = 0; tries < numRetries; tries++) {
       try {
         callable.instantiateServer(tries != 0);
@@ -1045,11 +1046,24 @@
           e = RemoteExceptionHandler.decodeRemoteException((RemoteException) e);
         }
         if (tries == numRetries - 1) {
+          if (LOG.isDebugEnabled()) {
+            String message = "Trying to contact region server for row '" + 
+              callable.row + "', but failed after " + (tries + 1)  + 
+              " attempts.\n";
+            int i = 1;
+            for (IOException e2 : exceptions) {
+              message = message + "Exception " + i + ":\n" + e;
+            }
+            LOG.debug(message);
+          }
           throw e;
+        } else {
+          if (LOG.isDebugEnabled()) {
+            exceptions.add(e);
+            LOG.debug("reloading table servers because: " + e.getMessage());
+          }
         }
-        if (LOG.isDebugEnabled()) {
-          LOG.debug("reloading table servers because: " + e.getMessage());
-        }
+
       } catch (Exception e) {
         throw new RuntimeException(e);
       }



Mime
View raw message