public class TestBucketCache extends Object
Tests will ensure that blocks' data correctness under several threads concurrency
Modifier and Type | Class and Description |
---|---|
private static class |
TestBucketCache.MockedBucketCache |
Modifier and Type | Field and Description |
---|---|
(package private) int |
BLOCK_SIZE |
(package private) org.apache.hadoop.hbase.io.hfile.bucket.BucketCache |
cache |
(package private) int |
CACHE_SIZE |
(package private) long |
capacitySize |
static HBaseClassTestRule |
CLASS_RULE |
int |
constructedBlockSize |
int[] |
constructedBlockSizes |
(package private) String |
ioEngineName |
(package private) int |
NUM_BLOCKS |
(package private) int |
NUM_QUERIES |
(package private) int |
NUM_THREADS |
(package private) String |
persistencePath |
private static Random |
RAND |
(package private) int |
writerQLen |
(package private) int |
writeThreads |
Constructor and Description |
---|
TestBucketCache() |
Modifier and Type | Method and Description |
---|---|
private void |
cacheAndWaitUntilFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache,
org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey,
org.apache.hadoop.hbase.io.hfile.Cacheable block) |
private void |
checkConfigValues(org.apache.hadoop.conf.Configuration conf,
Map<String,float[]> configMap,
boolean[] expectSuccess) |
static Iterable<Object[]> |
data() |
private static <T> T |
randFrom(List<T> a)
Return a random element from
a . |
void |
setup() |
void |
tearDown() |
void |
testBucketAllocator() |
void |
testBucketAllocatorLargeBuckets() |
void |
testCacheBlockNextBlockMetadataMissing() |
void |
testCacheMultiThreadedSingleKey() |
void |
testCacheSimple() |
void |
testFreeBlockWhenIOEngineWriteFailure() |
void |
testGetPartitionSize() |
void |
testHeapSizeChanges() |
void |
testInvalidAcceptFactorConfig() |
void |
testInvalidCacheSplitFactorConfig() |
void |
testInvalidExtraFreeFactorConfig() |
void |
testInvalidMinFactorConfig() |
void |
testMemoryLeak() |
void |
testOffsetProducesPositiveOutput() |
void |
testRAMCache() |
void |
testRetrieveFromFile() |
void |
testValidBucketCacheConfigs() |
private void |
validateGetPartitionSize(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache bucketCache,
float partitionFactor,
float minFactor) |
static void |
waitUntilAllFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache) |
static void |
waitUntilFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache,
org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey) |
public static final HBaseClassTestRule CLASS_RULE
public int constructedBlockSize
public int[] constructedBlockSizes
org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache
final int CACHE_SIZE
final int NUM_BLOCKS
final int BLOCK_SIZE
final int NUM_THREADS
final int NUM_QUERIES
final long capacitySize
final int writeThreads
final int writerQLen
String ioEngineName
String persistencePath
public TestBucketCache()
public void setup() throws IOException
IOException
public void tearDown()
public void testBucketAllocator() throws org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException
org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException
public void testCacheSimple() throws Exception
Exception
public void testCacheMultiThreadedSingleKey() throws Exception
Exception
public void testHeapSizeChanges() throws Exception
Exception
public static void waitUntilFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache, org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey) throws InterruptedException
InterruptedException
public static void waitUntilAllFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache) throws InterruptedException
InterruptedException
private void cacheAndWaitUntilFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache, org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey, org.apache.hadoop.hbase.io.hfile.Cacheable block) throws InterruptedException
InterruptedException
public void testMemoryLeak() throws Exception
Exception
public void testRetrieveFromFile() throws Exception
Exception
public void testBucketAllocatorLargeBuckets() throws org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException
org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException
public void testGetPartitionSize() throws IOException
IOException
public void testValidBucketCacheConfigs() throws IOException
IOException
public void testInvalidAcceptFactorConfig() throws IOException
IOException
public void testInvalidMinFactorConfig() throws IOException
IOException
public void testInvalidExtraFreeFactorConfig() throws IOException
IOException
public void testInvalidCacheSplitFactorConfig() throws IOException
IOException
private void checkConfigValues(org.apache.hadoop.conf.Configuration conf, Map<String,float[]> configMap, boolean[] expectSuccess) throws IOException
IOException
private void validateGetPartitionSize(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache bucketCache, float partitionFactor, float minFactor)
public void testOffsetProducesPositiveOutput()
public void testCacheBlockNextBlockMetadataMissing() throws Exception
Exception
public void testRAMCache()
public void testFreeBlockWhenIOEngineWriteFailure() throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.