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

edcoleman pushed a commit to branch elasticity
in repository https://gitbox.apache.org/repos/asf/accumulo.git

commit 7b3e52f1ae0f1a02d0804744137db521e96cf201
Merge: c7ae69b881 dcb09a726b
Author: Ed Coleman <edcole...@apache.org>
AuthorDate: Thu Mar 7 19:42:42 2024 +0000

    Merge remote-tracking branch 'upstream/main' into elasticity

 .../core/file/blockfile/cache/lru/LruBlockCache.java       | 14 ++++++++------
 .../file/blockfile/cache/tinylfu/TinyLfuBlockCache.java    |  4 ++--
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --cc 
core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/tinylfu/TinyLfuBlockCache.java
index feb6a1b5c1,04cab1a38c..3656b99815
--- 
a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/tinylfu/TinyLfuBlockCache.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/tinylfu/TinyLfuBlockCache.java
@@@ -63,15 -62,15 +63,15 @@@ public final class TinyLfuBlockCache im
    private final Policy.Eviction<String,Block> policy;
    private final int maxSize;
    private final ScheduledExecutorService statsExecutor = 
ThreadPools.getServerThreadPools()
-       .createScheduledExecutorService(1, "TinyLfuBlockCacheStatsExecutor", 
true);
+       .createScheduledExecutorService(1, "TinyLfuBlockCacheStatsExecutor", 
false);
  
    public TinyLfuBlockCache(Configuration conf, CacheType type) {
 -    cache = Caffeine.newBuilder()
 +    cache = 
Caches.getInstance().createNewBuilder(CacheName.TINYLFU_BLOCK_CACHE, false)
          .initialCapacity((int) Math.ceil(1.2 * conf.getMaxSize(type) / 
conf.getBlockSize()))
 -        .weigher((String blockName, Block block) -> {
 +        .recordStats().weigher((String blockName, Block block) -> {
            int keyWeight = ClassSize.align(blockName.length()) + 
ClassSize.STRING;
            return keyWeight + block.weight();
 -        }).maximumWeight(conf.getMaxSize(type)).recordStats().build();
 +        }).maximumWeight(conf.getMaxSize(type)).build();
      policy = cache.policy().eviction().orElseThrow();
      maxSize = (int) Math.min(Integer.MAX_VALUE, policy.getMaximum());
      ScheduledFuture<?> future = 
statsExecutor.scheduleAtFixedRate(this::logStats, STATS_PERIOD_SEC,

Reply via email to