This is an automated email from the ASF dual-hosted git repository.

cconnell pushed a commit to branch HBASE-29479/accurate-quota-cache
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit e17f6ab622d4698701a65262fbdcdbef481ed467
Author: Charles Connell <[email protected]>
AuthorDate: Wed Aug 27 13:10:02 2025 -0400

    Fix test issue exposed by this PR
---
 .../main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java  | 11 +++++++----
 .../apache/hadoop/hbase/quotas/TestDefaultAtomicQuota.java    |  9 ---------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
index 08627d92526..81a74b5a797 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java
@@ -48,6 +48,7 @@ import org.apache.yetus.audience.InterfaceAudience;
 import org.apache.yetus.audience.InterfaceStability;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+
 import org.apache.hbase.thirdparty.com.google.common.cache.CacheBuilder;
 import org.apache.hbase.thirdparty.com.google.common.cache.CacheLoader;
 import org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache;
@@ -202,7 +203,8 @@ public class QuotaCache implements Stoppable {
   public UserQuotaState getUserQuotaState(final UserGroupInformation ugi) {
     String user = getQuotaUserName(ugi);
     if (!userQuotaCache.containsKey(user)) {
-      userQuotaCache.put(user, 
QuotaUtil.buildDefaultUserQuotaState(rsServices.getConfiguration(), 0L));
+      userQuotaCache.put(user,
+        QuotaUtil.buildDefaultUserQuotaState(rsServices.getConfiguration(), 
0L));
       fetch("user", userQuotaCache, userQuotaStateFetcher);
     }
     return userQuotaCache.get(user);
@@ -270,8 +272,8 @@ public class QuotaCache implements Stoppable {
     }
   }
 
-  private <K, V extends QuotaState> void fetch(final String type,
-    final Map<K, V> quotasMap, final Fetcher<K, V> fetcher) {
+  private <K, V extends QuotaState> void fetch(final String type, final Map<K, 
V> quotasMap,
+    final Fetcher<K, V> fetcher) {
     // Find the quota entries to update
     List<Get> gets = 
quotasMap.keySet().stream().map(fetcher::makeGet).collect(Collectors.toList());
 
@@ -402,7 +404,8 @@ public class QuotaCache implements Stoppable {
       fetchAndEvict("namespace", QuotaCache.this.namespaceQuotaCache, 
namespaceQuotaStateFetcher);
       fetchAndEvict("table", QuotaCache.this.tableQuotaCache, 
tableQuotaStateFetcher);
       fetchAndEvict("user", QuotaCache.this.userQuotaCache, 
userQuotaStateFetcher);
-      fetchAndEvict("regionServer", QuotaCache.this.regionServerQuotaCache, 
regionServerQuotaStateFetcher);
+      fetchAndEvict("regionServer", QuotaCache.this.regionServerQuotaCache,
+        regionServerQuotaStateFetcher);
       fetchExceedThrottleQuota();
     }
 
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestDefaultAtomicQuota.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestDefaultAtomicQuota.java
index 383068259a4..87e3f7f332b 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestDefaultAtomicQuota.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestDefaultAtomicQuota.java
@@ -81,10 +81,6 @@ public class TestDefaultAtomicQuota {
 
   @Test
   public void testDefaultAtomicReadLimits() throws Exception {
-    // No write throttling
-    configureLenientThrottle(ThrottleType.ATOMIC_WRITE_SIZE);
-    refreshQuotas();
-
     // Should have a strict throttle by default
     TEST_UTIL.waitFor(60_000, () -> runIncTest(100) < 100);
 
@@ -102,11 +98,6 @@ public class TestDefaultAtomicQuota {
 
   @Test
   public void testDefaultAtomicWriteLimits() throws Exception {
-    // No read throttling
-    configureLenientThrottle(ThrottleType.ATOMIC_REQUEST_NUMBER);
-    configureLenientThrottle(ThrottleType.ATOMIC_READ_SIZE);
-    refreshQuotas();
-
     // Should have a strict throttle by default
     TEST_UTIL.waitFor(60_000, () -> runIncTest(100) < 100);
 

Reply via email to