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 a61f1082de
commit 2d5a5db80e
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"/>
</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);
}