hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From me...@apache.org
Subject [hbase] branch master updated: HBASE-22513 Admin#getQuota does not work correctly if exceedThrottleQuota is set
Date Mon, 03 Jun 2019 08:55:28 GMT
This is an automated email from the ASF dual-hosted git repository.

meiyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 073de44  HBASE-22513 Admin#getQuota does not work correctly if exceedThrottleQuota
is set
073de44 is described below

commit 073de44445eb9a74d73ec64647d5bb9f877127f3
Author: meiyi <myimeiyi@gmail.com>
AuthorDate: Mon Jun 3 16:55:23 2019 +0800

    HBASE-22513 Admin#getQuota does not work correctly if exceedThrottleQuota is set
---
 .../main/java/org/apache/hadoop/hbase/quotas/QuotaRetriever.java    | 6 ++++++
 .../test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java    | 1 +
 2 files changed, 7 insertions(+)

diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaRetriever.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaRetriever.java
index d8dd50b..a48ce71 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaRetriever.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaRetriever.java
@@ -26,6 +26,7 @@ import java.util.Objects;
 import java.util.Queue;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.yetus.audience.InterfaceAudience;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -102,6 +103,11 @@ public class QuotaRetriever implements Closeable, Iterable<QuotaSettings>
{
   public QuotaSettings next() throws IOException {
     if (cache.isEmpty()) {
       Result result = scanner.next();
+      // Skip exceedThrottleQuota row key because this is not a QuotaSettings
+      if (result != null
+          && Bytes.equals(result.getRow(), QuotaTableUtil.getExceedThrottleQuotaRowKey()))
{
+        result = scanner.next();
+      }
       if (result == null) {
         return null;
       }
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java
index 6c5ebdf..0045ec8 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java
@@ -636,6 +636,7 @@ public class TestQuotaAdmin {
     assertTrue(admin.exceedThrottleQuotaSwitch(true));
     assertTrue(admin.exceedThrottleQuotaSwitch(false));
     assertFalse(admin.exceedThrottleQuotaSwitch(false));
+    assertEquals(2, admin.getQuota(new QuotaFilter()).size());
     admin.setQuota(QuotaSettingsFactory.unthrottleRegionServer(regionServer));
   }
 


Mime
View raw message