rmdmattingly commented on code in PR #6451:
URL: https://github.com/apache/hbase/pull/6451#discussion_r1834889163


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaCache.java:
##########
@@ -233,8 +242,33 @@ Map<String, UserQuotaState> getUserQuotaCache() {
   private class QuotaRefresherChore extends ScheduledChore {
     private long lastUpdate = 0;
 
-    public QuotaRefresherChore(final int period, final Stoppable stoppable) {
+    // Querying cluster metrics so often, per-RegionServer, limits horizontal 
scalability.
+    // So we cache the results to reduce that load.
+    private final RefreshableExpiringValueCache<ClusterMetrics> 
tableRegionStatesClusterMetrics;
+    private final RefreshableExpiringValueCache<Integer> regionServersSize;
+
+    public QuotaRefresherChore(Configuration conf, final int period, final 
Stoppable stoppable) {
       super("QuotaRefresherChore", stoppable, period);
+
+      Duration tableRegionStatesCacheTtl =
+        Duration.ofMillis(conf.getLong(TABLE_REGION_STATES_CACHE_TTL_MS, 
period));
+      this.tableRegionStatesClusterMetrics =
+        new RefreshableExpiringValueCache<>("tableRegionStatesClusterMetrics",

Review Comment:
   That would definitely be nice, and would probably be a larger refactor so it 
would definitely be nice to make that a separate issue. The quota refresh 
period is also static, and should probably be made dynamic in that same push



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to