Skip to content

Commit 665e0ea

Browse files
committed
Revert "HBASE-22699 refactor isMetaClearingException (#436)"
This reverts commit cc6e157.
1 parent cc6e157 commit 665e0ea

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/ClientExceptionsUtil.java

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.apache.hadoop.hbase.CallDroppedException;
3333
import org.apache.hadoop.hbase.CallQueueTooBigException;
3434
import org.apache.hadoop.hbase.DoNotRetryIOException;
35+
import org.apache.hadoop.hbase.MultiActionResultTooLarge;
3536
import org.apache.hadoop.hbase.NotServingRegionException;
3637
import org.apache.hadoop.hbase.RegionTooBusyException;
3738
import org.apache.hadoop.hbase.RetryImmediatelyException;
@@ -58,23 +59,18 @@ public static boolean isMetaClearingException(Throwable cur) {
5859
if (cur == null) {
5960
return true;
6061
}
61-
return !regionDefinitelyOnTheRegionServerException(cur);
62+
return !isSpecialException(cur) || (cur instanceof RegionMovedException)
63+
|| cur instanceof NotServingRegionException;
6264
}
6365

64-
private static boolean regionDefinitelyOnTheRegionServerException(Throwable t) {
65-
return (t instanceof RegionTooBusyException || t instanceof RpcThrottlingException
66-
|| t instanceof RetryImmediatelyException || t instanceof CallQueueTooBigException
67-
|| t instanceof CallDroppedException || t instanceof NotServingRegionException
68-
|| t instanceof RequestTooBigException);
66+
public static boolean isSpecialException(Throwable cur) {
67+
return (cur instanceof RegionMovedException || cur instanceof RegionOpeningException
68+
|| cur instanceof RegionTooBusyException || cur instanceof RpcThrottlingException
69+
|| cur instanceof MultiActionResultTooLarge || cur instanceof RetryImmediatelyException
70+
|| cur instanceof CallQueueTooBigException || cur instanceof CallDroppedException
71+
|| cur instanceof NotServingRegionException || cur instanceof RequestTooBigException);
6972
}
7073

71-
/**
72-
* This function is the alias of regionDefinitelyOnTheRegionServerException,
73-
* whose name is confusing in the function findException().
74-
*/
75-
private static boolean matchExceptionWeCare(Throwable t) {
76-
return regionDefinitelyOnTheRegionServerException(t);
77-
}
7874

7975
/**
8076
* Look for an exception we know in the remote exception:
@@ -91,15 +87,15 @@ public static Throwable findException(Object exception) {
9187
}
9288
Throwable cur = (Throwable) exception;
9389
while (cur != null) {
94-
if (matchExceptionWeCare(cur)) {
90+
if (isSpecialException(cur)) {
9591
return cur;
9692
}
9793
if (cur instanceof RemoteException) {
9894
RemoteException re = (RemoteException) cur;
9995
cur = re.unwrapRemoteException();
10096

10197
// unwrapRemoteException can return the exception given as a parameter when it cannot
102-
// unwrap it. In this case, there is no need to look further
98+
// unwrap it. In this case, there is no need to look further
10399
// noinspection ObjectEquality
104100
if (cur == re) {
105101
return cur;

0 commit comments

Comments
 (0)