From a63e3ac83ffb91948f464e4f62111d29adc02812 Mon Sep 17 00:00:00 2001 From: "terence.yoo" Date: Thu, 9 Jul 2015 13:43:37 +0900 Subject: [PATCH] HBASE-14041 Do not clear MetaCache if a ThrottlingException is thrown Signed-off-by: Sean Busbey --- .../hadoop/hbase/client/ConnectionImplementation.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java index 35ff34fecb4..2754997a9b3 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java @@ -56,6 +56,7 @@ import org.apache.hadoop.hbase.protobuf.generated.ClientProtos; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsBalancerEnabledRequest; import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.IsBalancerEnabledResponse; +import org.apache.hadoop.hbase.quotas.ThrottlingException; import org.apache.hadoop.hbase.regionserver.RegionServerStoppedException; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.util.Bytes; @@ -263,7 +264,8 @@ class ConnectionImplementation implements ClusterConnection, Closeable { * - hadoop.ipc wrapped exceptions * - nested exceptions * - * Looks for: RegionMovedException / RegionOpeningException / RegionTooBusyException + * Looks for: RegionMovedException / RegionOpeningException / RegionTooBusyException / + * ThrottlingException * @return null if we didn't find the exception, the exception otherwise. */ public static Throwable findException(Object exception) { @@ -273,7 +275,7 @@ class ConnectionImplementation implements ClusterConnection, Closeable { Throwable cur = (Throwable) exception; while (cur != null) { if (cur instanceof RegionMovedException || cur instanceof RegionOpeningException - || cur instanceof RegionTooBusyException) { + || cur instanceof RegionTooBusyException || cur instanceof ThrottlingException) { return cur; } if (cur instanceof RemoteException) { @@ -1840,7 +1842,8 @@ class ConnectionImplementation implements ClusterConnection, Closeable { HRegionInfo regionInfo = oldLocation.getRegionInfo(); Throwable cause = findException(exception); if (cause != null) { - if (cause instanceof RegionTooBusyException || cause instanceof RegionOpeningException) { + if (cause instanceof RegionTooBusyException || cause instanceof RegionOpeningException + || cause instanceof ThrottlingException) { // We know that the region is still on this region server return; }