hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject hbase git commit: HBASE-17763 IPCUtil.wrapException will wrap DoNotRetryIOException with IOException
Date Fri, 10 Mar 2017 07:38:14 GMT
Repository: hbase
Updated Branches:
  refs/heads/master ab5970773 -> ed6e5d699


HBASE-17763 IPCUtil.wrapException will wrap DoNotRetryIOException with IOException


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/ed6e5d69
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ed6e5d69
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ed6e5d69

Branch: refs/heads/master
Commit: ed6e5d69995432aec4daf1a550edc8395fbc8930
Parents: ab59707
Author: zhangduo <zhangduo@apache.org>
Authored: Thu Mar 9 17:29:55 2017 +0800
Committer: zhangduo <zhangduo@apache.org>
Committed: Fri Mar 10 15:37:59 2017 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java    |  7 +++++++
 .../test/java/org/apache/hadoop/hbase/client/TestHCM.java | 10 ++++------
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/ed6e5d69/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
index 44e98fe..d2e0e90 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/IPCUtil.java
@@ -28,6 +28,7 @@ import java.net.InetSocketAddress;
 import java.net.SocketTimeoutException;
 import java.nio.ByteBuffer;
 
+import org.apache.hadoop.hbase.DoNotRetryIOException;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.ConnectionClosingException;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.CellBlockMeta;
@@ -168,6 +169,12 @@ class IPCUtil {
     } else if (exception instanceof ConnectionClosingException) {
       return (ConnectionClosingException) new ConnectionClosingException(
           "Call to " + addr + " failed on local exception: " + exception).initCause(exception);
+    } else if (exception instanceof ServerTooBusyException) {
+      // we already have address in the exception message
+      return (IOException) exception;
+    } else if (exception instanceof DoNotRetryIOException) {
+      return (IOException) new DoNotRetryIOException(
+          "Call to " + addr + " failed on local exception: " + exception).initCause(exception);
     } else {
       return (IOException) new IOException(
           "Call to " + addr + " failed on local exception: " + exception).initCause(exception);

http://git-wip-us.apache.org/repos/asf/hbase/blob/ed6e5d69/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
index 70be7fa..bfe10b5 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
@@ -1494,7 +1494,7 @@ public class TestHCM {
         p.addColumn(FAM_NAM, new byte[]{0}, new byte[]{0});
         table.put(p);
       } catch (RetriesExhaustedWithDetailsException e) {
-        if (e.exceptions.get(0).getCause() instanceof ServerTooBusyException) {
+        if (e.exceptions.get(0) instanceof ServerTooBusyException) {
           getServerBusyException = 1;
         }
       } catch (IOException ignore) {
@@ -1514,12 +1514,10 @@ public class TestHCM {
     public void run() {
       try {
         Get g = new Get(ROW);
-        g.addColumn(FAM_NAM, new byte[]{0});
+        g.addColumn(FAM_NAM, new byte[] { 0 });
         table.get(g);
-      } catch (RetriesExhaustedException e) {
-        if (e.getCause().getCause() instanceof ServerTooBusyException) {
-          getServerBusyException = 1;
-        }
+      } catch (ServerTooBusyException e) {
+        getServerBusyException = 1;
       } catch (IOException ignore) {
       }
     }


Mime
View raw message