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 GitHub
parent e88f54b485
commit b2f85e5fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2602 additions and 0 deletions

View File

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

View File

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