You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "dlmarion (via GitHub)" <gi...@apache.org> on 2023/07/19 12:07:01 UTC

[GitHub] [accumulo] dlmarion commented on a diff in pull request #3629: Created single code path for Caffeine Caches with metrics

dlmarion commented on code in PR #3629:
URL: https://github.com/apache/accumulo/pull/3629#discussion_r1267978122


##########
core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/tinylfu/TinyLfuBlockCache.java:
##########
@@ -65,12 +66,14 @@ public final class TinyLfuBlockCache implements BlockCache {
       .createScheduledExecutorService(1, "TinyLfuBlockCacheStatsExecutor", true);
 
   public TinyLfuBlockCache(Configuration conf, CacheType type) {
-    cache = Caffeine.newBuilder()
-        .initialCapacity((int) Math.ceil(1.2 * conf.getMaxSize(type) / conf.getBlockSize()))
-        .weigher((String blockName, Block block) -> {
+    cache = Caches.getInstance().getCache(CacheName.TINYLFU_BLOCK_CACHE,

Review Comment:
   Short answer: the block caches won't report via Micrometer
   
   Long answer: The block caches report their stats differently, via a CacheStats object IIRC. Because `recordStats` is called on line 72 below, the `recordStats` call in Caches throws an IllegalStateException and reporting via Micrometer won't occur.



-- 
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