Skip to content

Commit 17ea99c

Browse files
mymeiyimeiyi
authored andcommitted
HBASE-22513 Admin#getQuota does not work correctly if exceedThrottleQuota is set
1 parent d1035c8 commit 17ea99c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaRetriever.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.Queue;
2727

2828
import org.apache.hadoop.conf.Configuration;
29+
import org.apache.hadoop.hbase.util.Bytes;
2930
import org.apache.yetus.audience.InterfaceAudience;
3031
import org.slf4j.Logger;
3132
import org.slf4j.LoggerFactory;
@@ -102,6 +103,11 @@ public void close() throws IOException {
102103
public QuotaSettings next() throws IOException {
103104
if (cache.isEmpty()) {
104105
Result result = scanner.next();
106+
// Skip exceedThrottleQuota row key because this is not a QuotaSettings
107+
if (result != null
108+
&& Bytes.equals(result.getRow(), QuotaTableUtil.getExceedThrottleQuotaRowKey())) {
109+
result = scanner.next();
110+
}
105111
if (result == null) {
106112
return null;
107113
}

hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaAdmin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ public void testSwitchExceedThrottleQuota() throws IOException {
636636
assertTrue(admin.exceedThrottleQuotaSwitch(true));
637637
assertTrue(admin.exceedThrottleQuotaSwitch(false));
638638
assertFalse(admin.exceedThrottleQuotaSwitch(false));
639+
assertEquals(2, admin.getQuota(new QuotaFilter()).size());
639640
admin.setQuota(QuotaSettingsFactory.unthrottleRegionServer(regionServer));
640641
}
641642

0 commit comments

Comments
 (0)