cshannon commented on code in PR #4551:
URL: https://github.com/apache/accumulo/pull/4551#discussion_r1613998074


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java:
##########
@@ -247,9 +247,31 @@ public ScanServer(ScanServerOpts opts, String[] args) {
         LOG.warn(
             "Tablet metadata caching less than one minute, may cause excessive 
scans on metadata table.");
       }
-      tabletMetadataCache =
-          Caffeine.newBuilder().expireAfterWrite(cacheExpiration, 
TimeUnit.MILLISECONDS)
-              
.scheduler(Scheduler.systemScheduler()).recordStats().build(tabletMetadataLoader);
+
+      // Get the cache refresh percentage property
+      // Value must be less than 100% as 100 or over would effectively disable 
it
+      double cacheRefreshPercentage =
+          
getConfiguration().getFraction(Property.SSERV_CACHED_TABLET_METADATA_REFRESH_PERCENT);
+      Preconditions.checkArgument(cacheRefreshPercentage < cacheExpiration,
+          "Tablet metadata cache refresh percentage is '%s' but must be less 
than 1",
+          cacheRefreshPercentage);
+
+      var builder = Caffeine.newBuilder().expireAfterWrite(cacheExpiration, 
TimeUnit.MILLISECONDS)
+          
.scheduler(Scheduler.systemScheduler()).executor(context.getScheduledExecutor())

Review Comment:
   I created a dedicated executor with a fixed pool size of 8 for now to keep 
it simple. It's a sync cache and we are not using it for loading just for other 
things like refresh, expiration tasks, etc. If we are not keeping up or need 
more control we could add a property to make the size configurable or bump up 
the executor size.



-- 
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: notifications-unsubscr...@accumulo.apache.org

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

Reply via email to