3232import org .apache .hadoop .hbase .CallDroppedException ;
3333import org .apache .hadoop .hbase .CallQueueTooBigException ;
3434import org .apache .hadoop .hbase .DoNotRetryIOException ;
35+ import org .apache .hadoop .hbase .MultiActionResultTooLarge ;
3536import org .apache .hadoop .hbase .NotServingRegionException ;
3637import org .apache .hadoop .hbase .RegionTooBusyException ;
3738import 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