32
32
import org .apache .hadoop .hbase .CallDroppedException ;
33
33
import org .apache .hadoop .hbase .CallQueueTooBigException ;
34
34
import org .apache .hadoop .hbase .DoNotRetryIOException ;
35
- import org .apache .hadoop .hbase .MultiActionResultTooLarge ;
36
35
import org .apache .hadoop .hbase .NotServingRegionException ;
37
36
import org .apache .hadoop .hbase .RegionTooBusyException ;
38
37
import org .apache .hadoop .hbase .RetryImmediatelyException ;
@@ -59,18 +58,23 @@ public static boolean isMetaClearingException(Throwable cur) {
59
58
if (cur == null ) {
60
59
return true ;
61
60
}
62
- return !isSpecialException (cur ) || (cur instanceof RegionMovedException )
63
- || cur instanceof NotServingRegionException ;
61
+ return !regionDefinitelyOnTheRegionServerException (cur );
64
62
}
65
63
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 );
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 );
72
69
}
73
70
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
+ }
74
78
75
79
/**
76
80
* Look for an exception we know in the remote exception:
@@ -87,15 +91,15 @@ public static Throwable findException(Object exception) {
87
91
}
88
92
Throwable cur = (Throwable ) exception ;
89
93
while (cur != null ) {
90
- if (isSpecialException (cur )) {
94
+ if (matchExceptionWeCare (cur )) {
91
95
return cur ;
92
96
}
93
97
if (cur instanceof RemoteException ) {
94
98
RemoteException re = (RemoteException ) cur ;
95
99
cur = re .unwrapRemoteException ();
96
100
97
101
// unwrapRemoteException can return the exception given as a parameter when it cannot
98
- // unwrap it. In this case, there is no need to look further
102
+ // unwrap it. In this case, there is no need to look further
99
103
// noinspection ObjectEquality
100
104
if (cur == re ) {
101
105
return cur ;
0 commit comments