You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "keith-turner (via GitHub)" <gi...@apache.org> on 2023/05/30 13:10:45 UTC

[GitHub] [accumulo] keith-turner commented on a diff in pull request #3437: moves hosting request processing from tserver to manager

keith-turner commented on code in PR #3437:
URL: https://github.com/apache/accumulo/pull/3437#discussion_r1210250548


##########
server/manager/src/main/java/org/apache/accumulo/manager/ManagerClientServiceHandler.java:
##########
@@ -89,13 +93,22 @@
 import org.apache.zookeeper.KeeperException.NoNodeException;
 import org.slf4j.Logger;
 
+import com.github.benmanes.caffeine.cache.Cache;
+import com.github.benmanes.caffeine.cache.Caffeine;
+import com.github.benmanes.caffeine.cache.Weigher;
+
 public class ManagerClientServiceHandler implements ManagerClientService.Iface {
 
   private static final Logger log = Manager.log;
   private final Manager manager;
 
+  private final Cache<KeyExtent,Long> recentHostingRequest;
+
   protected ManagerClientServiceHandler(Manager manager) {
     this.manager = manager;
+    Weigher<KeyExtent,Long> weigher = (extent, t) -> Splitter.weigh(extent) + 8;
+    this.recentHostingRequest = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES)
+        .maximumWeight(10_000_000L).weigher(weigher).build();

Review Comment:
   Should be a max mem of 10M not including overhead of java objects.



-- 
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-unsubscribe@accumulo.apache.org

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