public class TestLruBlockCache extends Object
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.
Modifier and Type | Class and Description |
---|---|
private static class |
TestLruBlockCache.CachedItem |
Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
Constructor and Description |
---|
TestLruBlockCache() |
Modifier and Type | Method and Description |
---|---|
private long |
calculateBlockSize(long maxSize,
int numBlocks) |
private long |
calculateBlockSizeDefault(long maxSize,
int numBlocks) |
private TestLruBlockCache.CachedItem[] |
generateFixedBlocks(int numBlocks,
int size,
String pfx) |
private TestLruBlockCache.CachedItem[] |
generateFixedBlocks(int numBlocks,
long size,
String pfx) |
private TestLruBlockCache.CachedItem[] |
generateRandomBlocks(int numBlocks,
long maxSize) |
void |
testBackgroundEvictionThread() |
void |
testCacheBlockNextBlockMetadataMissing() |
void |
testCacheEvictionInMemoryForceMode() |
void |
testCacheEvictionSimple() |
void |
testCacheEvictionThreadSafe() |
void |
testCacheEvictionThreePriorities() |
void |
testCacheEvictionTwoPriorities() |
void |
testCacheSimple() |
void |
testMaxBlockSize() |
void |
testPastNPeriodsMetrics() |
void |
testResizeBlockCache() |
void |
testScanResistance() |
public static final HBaseClassTestRule CLASS_RULE
public TestLruBlockCache()
public void testCacheEvictionThreadSafe() throws Exception
Exception
public void testBackgroundEvictionThread() throws Exception
Exception
public void testCacheSimple() throws Exception
Exception
public void testCacheEvictionSimple() throws Exception
Exception
public void testCacheEvictionTwoPriorities() throws Exception
Exception
public void testCacheEvictionThreePriorities() throws Exception
Exception
public void testCacheEvictionInMemoryForceMode() throws Exception
Exception
public void testScanResistance() throws Exception
Exception
public void testMaxBlockSize() throws Exception
Exception
public void testResizeBlockCache() throws Exception
Exception
public void testPastNPeriodsMetrics() throws Exception
Exception
public void testCacheBlockNextBlockMetadataMissing()
private TestLruBlockCache.CachedItem[] generateFixedBlocks(int numBlocks, int size, String pfx)
private TestLruBlockCache.CachedItem[] generateFixedBlocks(int numBlocks, long size, String pfx)
private TestLruBlockCache.CachedItem[] generateRandomBlocks(int numBlocks, long maxSize)
private long calculateBlockSize(long maxSize, int numBlocks)
private long calculateBlockSizeDefault(long maxSize, int numBlocks)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.