Package org.apache.hadoop.hbase.io.hfile
Class TestLruAdaptiveBlockCache
java.lang.Object
org.apache.hadoop.hbase.io.hfile.TestLruAdaptiveBlockCache
Tests the concurrent LruAdaptiveBlockCache.
Tests will ensure it grows and shrinks in size properly, evictions run when they're supposed to and do what they should, and that cached blocks are accessible when expected to be.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final org.apache.hadoop.conf.Configuration
private static final org.slf4j.Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate long
calculateBlockSize
(long maxSize, int numBlocks) private long
calculateBlockSizeDefault
(long maxSize, int numBlocks) private TestLruAdaptiveBlockCache.CachedItem[]
generateFixedBlocks
(int numBlocks, int size, String pfx) private TestLruAdaptiveBlockCache.CachedItem[]
generateFixedBlocks
(int numBlocks, long size, String pfx) private TestLruAdaptiveBlockCache.CachedItem[]
generateRandomBlocks
(int numBlocks, long maxSize) void
void
void
void
void
void
void
void
void
void
(package private) static void
testMultiThreadGetAndEvictBlockInternal
(org.apache.hadoop.hbase.io.hfile.BlockCache cache) void
void
void
void
void
testSkipCacheDataBlocksInteral
(int heavyEvictionCountLimit)
-
Field Details
-
CLASS_RULE
-
LOG
-
CONF
-
-
Constructor Details
-
TestLruAdaptiveBlockCache
public TestLruAdaptiveBlockCache()
-
-
Method Details
-
testCacheEvictionThreadSafe
- Throws:
Exception
-
testBackgroundEvictionThread
- Throws:
Exception
-
testCacheSimple
- Throws:
Exception
-
testCacheEvictionSimple
- Throws:
Exception
-
testCacheEvictionTwoPriorities
- Throws:
Exception
-
testCacheEvictionThreePriorities
- Throws:
Exception
-
testCacheEvictionInMemoryForceMode
- Throws:
Exception
-
testScanResistance
- Throws:
Exception
-
testMaxBlockSize
- Throws:
Exception
-
testResizeBlockCache
- Throws:
Exception
-
testPastNPeriodsMetrics
- Throws:
Exception
-
testCacheBlockNextBlockMetadataMissing
-
generateFixedBlocks
private TestLruAdaptiveBlockCache.CachedItem[] generateFixedBlocks(int numBlocks, int size, String pfx) -
generateFixedBlocks
private TestLruAdaptiveBlockCache.CachedItem[] generateFixedBlocks(int numBlocks, long size, String pfx) -
generateRandomBlocks
-
calculateBlockSize
-
calculateBlockSizeDefault
-
testMultiThreadGetAndEvictBlockInternal
static void testMultiThreadGetAndEvictBlockInternal(org.apache.hadoop.hbase.io.hfile.BlockCache cache) throws Exception - Throws:
Exception
-
testMultiThreadGetAndEvictBlock
- Throws:
Exception
-
testSkipCacheDataBlocksInteral
- Throws:
Exception
-
testSkipCacheDataBlocks
- Throws:
Exception
-