hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [hbase] branch branch-2.0 updated: Revert "HBASE-22699 refactor isMetaClearingException (#436)"
Date Mon, 12 Aug 2019 18:02:16 GMT
This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 5ed41ee  Revert "HBASE-22699 refactor isMetaClearingException (#436)"
5ed41ee is described below

commit 5ed41ee298b8265096f8ba692d5caabbce002801
Author: stack <stack@apache.org>
AuthorDate: Mon Aug 12 10:57:39 2019 -0700

    Revert "HBASE-22699 refactor isMetaClearingException (#436)"
    
    This reverts commit beb307b84738a13f5f55ab156960dc3b29013e9e.
---
 .../hbase/exceptions/ClientExceptionsUtil.java     | 26 +++++++++-------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java
index 1975297..6b1e251 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java
@@ -32,6 +32,7 @@ import java.util.concurrent.TimeoutException;
 import org.apache.hadoop.hbase.CallDroppedException;
 import org.apache.hadoop.hbase.CallQueueTooBigException;
 import org.apache.hadoop.hbase.DoNotRetryIOException;
+import org.apache.hadoop.hbase.MultiActionResultTooLarge;
 import org.apache.hadoop.hbase.NotServingRegionException;
 import org.apache.hadoop.hbase.RegionTooBusyException;
 import org.apache.hadoop.hbase.RetryImmediatelyException;
@@ -58,23 +59,18 @@ public final class ClientExceptionsUtil {
     if (cur == null) {
       return true;
     }
-    return !regionDefinitelyOnTheRegionServerException(cur);
+    return !isSpecialException(cur) || (cur instanceof RegionMovedException)
+        || cur instanceof NotServingRegionException;
   }
 
-  private static boolean regionDefinitelyOnTheRegionServerException(Throwable t) {
-    return (t instanceof RegionTooBusyException || t instanceof RpcThrottlingException
-        || t instanceof RetryImmediatelyException || t instanceof CallQueueTooBigException
-        || t instanceof CallDroppedException || t instanceof NotServingRegionException
-        || t instanceof RequestTooBigException);
+  public static boolean isSpecialException(Throwable cur) {
+    return (cur instanceof RegionMovedException || cur instanceof RegionOpeningException
+        || cur instanceof RegionTooBusyException || cur instanceof RpcThrottlingException
+        || cur instanceof MultiActionResultTooLarge || cur instanceof RetryImmediatelyException
+        || cur instanceof CallQueueTooBigException || cur instanceof CallDroppedException
+        || cur instanceof NotServingRegionException || cur instanceof RequestTooBigException);
   }
 
-  /**
-   * This function is the alias of regionDefinitelyOnTheRegionServerException,
-   * whose name is confusing in the function findException().
-   */
-  private static boolean matchExceptionWeCare(Throwable t) {
-    return regionDefinitelyOnTheRegionServerException(t);
-  }
 
   /**
    * Look for an exception we know in the remote exception:
@@ -91,7 +87,7 @@ public final class ClientExceptionsUtil {
     }
     Throwable cur = (Throwable) exception;
     while (cur != null) {
-      if (matchExceptionWeCare(cur)) {
+      if (isSpecialException(cur)) {
         return cur;
       }
       if (cur instanceof RemoteException) {
@@ -99,7 +95,7 @@ public final class ClientExceptionsUtil {
         cur = re.unwrapRemoteException();
 
         // unwrapRemoteException can return the exception given as a parameter when it cannot
-        // unwrap it. In this case, there is no need to look further
+        //  unwrap it. In this case, there is no need to look further
         // noinspection ObjectEquality
         if (cur == re) {
           return cur;


Mime
View raw message