HBASE-23887 AdaptiveLRU cache (#2934)

Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
pustota2009 2021-02-13 17:27:28 +03:00 committed by Viraj Jasani
parent 56937056ea
commit 79272e481b
No known key found for this signature in database
GPG Key ID: B3D6C0B41C8ADFD5
4 changed files with 2602 additions and 0 deletions

View File

@ -247,4 +247,9 @@
<Bug pattern="SC_START_IN_CTOR"/> <Bug pattern="SC_START_IN_CTOR"/>
</Match> </Match>
<Match>
<Class name="org.apache.hadoop.hbase.io.hfile.LruAdaptiveBlockCache"/>
<Bug pattern="SC_START_IN_CTOR"/>
</Match>
</FindBugsFilter> </FindBugsFilter>

View File

@ -145,6 +145,8 @@ public final class BlockCacheFactory {
return new LruBlockCache(cacheSize, blockSize, true, c); return new LruBlockCache(cacheSize, blockSize, true, c);
} else if (policy.equalsIgnoreCase("TinyLFU")) { } else if (policy.equalsIgnoreCase("TinyLFU")) {
return new TinyLfuBlockCache(cacheSize, blockSize, ForkJoinPool.commonPool(), c); return new TinyLfuBlockCache(cacheSize, blockSize, ForkJoinPool.commonPool(), c);
} else if (policy.equalsIgnoreCase("AdaptiveLRU")) {
return new LruAdaptiveBlockCache(cacheSize, blockSize, true, c);
} else { } else {
throw new IllegalArgumentException("Unknown policy: " + policy); throw new IllegalArgumentException("Unknown policy: " + policy);
} }