You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2015/04/09 22:59:10 UTC
[05/50] [abbrv] hbase git commit: HBASE-13411 Misleading error
message when request size quota limit exceeds
HBASE-13411 Misleading error message when request size quota limit exceeds
Signed-off-by: Matteo Bertozzi <ma...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/8c740f43
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/8c740f43
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/8c740f43
Branch: refs/heads/hbase-12439
Commit: 8c740f43093671cfd4cc2b1052d8556e0d492c13
Parents: 8c70749
Author: Ashish Singhi <as...@huawei.com>
Authored: Mon Apr 6 18:49:10 2015 +0530
Committer: Matteo Bertozzi <ma...@cloudera.com>
Committed: Mon Apr 6 22:31:07 2015 +0100
----------------------------------------------------------------------
.../apache/hadoop/hbase/quotas/ThrottlingException.java | 11 +++++++----
.../org/apache/hadoop/hbase/quotas/TimeBasedLimiter.java | 9 +++------
2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/8c740f43/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/ThrottlingException.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/ThrottlingException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/ThrottlingException.java
index dad1edd..293e9c6 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/ThrottlingException.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/ThrottlingException.java
@@ -21,8 +21,6 @@ package org.apache.hadoop.hbase.quotas;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.classification.InterfaceAudience;
import org.apache.hadoop.hbase.classification.InterfaceStability;
@@ -38,12 +36,11 @@ import org.apache.hadoop.hbase.classification.InterfaceStability;
public class ThrottlingException extends QuotaExceededException {
private static final long serialVersionUID = 1406576492085155743L;
- private static final Log LOG = LogFactory.getLog(ThrottlingException.class);
-
@InterfaceAudience.Public
@InterfaceStability.Evolving
public enum Type {
NumRequestsExceeded,
+ RequestSizeExceeded,
NumReadRequestsExceeded,
NumWriteRequestsExceeded,
WriteSizeExceeded,
@@ -52,6 +49,7 @@ public class ThrottlingException extends QuotaExceededException {
private static final String[] MSG_TYPE = new String[] {
"number of requests exceeded",
+ "request size limit exceeded",
"number of read requests exceeded",
"number of write requests exceeded",
"write size limit exceeded",
@@ -98,6 +96,11 @@ public class ThrottlingException extends QuotaExceededException {
throwThrottlingException(Type.NumRequestsExceeded, waitInterval);
}
+ public static void throwRequestSizeExceeded(final long waitInterval)
+ throws ThrottlingException {
+ throwThrottlingException(Type.RequestSizeExceeded, waitInterval);
+ }
+
public static void throwNumReadRequestsExceeded(final long waitInterval)
throws ThrottlingException {
throwThrottlingException(Type.NumReadRequestsExceeded, waitInterval);
http://git-wip-us.apache.org/repos/asf/hbase/blob/8c740f43/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/TimeBasedLimiter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/TimeBasedLimiter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/TimeBasedLimiter.java
index 8ca7e6b..79687a9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/TimeBasedLimiter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/TimeBasedLimiter.java
@@ -19,12 +19,10 @@
package org.apache.hadoop.hbase.quotas;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.classification.InterfaceAudience;
import org.apache.hadoop.hbase.classification.InterfaceStability;
-import org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.Throttle;
import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.Throttle;
import org.apache.hadoop.hbase.protobuf.generated.QuotaProtos.TimedQuota;
import org.apache.hadoop.hbase.quotas.OperationQuota.AvgOperationSize;
import org.apache.hadoop.hbase.quotas.OperationQuota.OperationType;
@@ -36,8 +34,6 @@ import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class TimeBasedLimiter implements QuotaLimiter {
- private static final Log LOG = LogFactory.getLog(TimeBasedLimiter.class);
-
private long writeLastTs = 0;
private long readLastTs = 0;
@@ -110,7 +106,8 @@ public class TimeBasedLimiter implements QuotaLimiter {
ThrottlingException.throwNumRequestsExceeded(reqsLimiter.waitInterval());
}
if (!reqSizeLimiter.canExecute(now, lastTs, writeSize + readSize)) {
- ThrottlingException.throwNumRequestsExceeded(reqSizeLimiter.waitInterval(writeSize+readSize));
+ ThrottlingException.throwRequestSizeExceeded(reqSizeLimiter
+ .waitInterval(writeSize + readSize));
}
if (writeSize > 0) {