Skip to content

Commit b2f85e5

Browse files
authored
HBASE-23887 AdaptiveLRU cache (#2934)
Signed-off-by: Viraj Jasani <[email protected]>
1 parent e88f54b commit b2f85e5

File tree

4 files changed

+2602
-0
lines changed

4 files changed

+2602
-0
lines changed

dev-support/spotbugs-exclude.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,9 @@
247247
<Bug pattern="SC_START_IN_CTOR"/>
248248
</Match>
249249

250+
<Match>
251+
<Class name="org.apache.hadoop.hbase.io.hfile.LruAdaptiveBlockCache"/>
252+
<Bug pattern="SC_START_IN_CTOR"/>
253+
</Match>
254+
250255
</FindBugsFilter>

hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ private static FirstLevelBlockCache createFirstLevelCache(final Configuration c)
145145
return new LruBlockCache(cacheSize, blockSize, true, c);
146146
} else if (policy.equalsIgnoreCase("TinyLFU")) {
147147
return new TinyLfuBlockCache(cacheSize, blockSize, ForkJoinPool.commonPool(), c);
148+
} else if (policy.equalsIgnoreCase("AdaptiveLRU")) {
149+
return new LruAdaptiveBlockCache(cacheSize, blockSize, true, c);
148150
} else {
149151
throw new IllegalArgumentException("Unknown policy: " + policy);
150152
}

0 commit comments

Comments
 (0)