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 | testRetrieveFromFile() | 
| void | testValidBucketCacheConfigs() | 
| private void | validateGetPartitionSize(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache bucketCache,
                        float partitionFactor,
                        float minFactor) | 
| private 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 FileNotFoundException, IOException
FileNotFoundExceptionIOExceptionpublic void tearDown()
public void testBucketAllocator() throws org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException
org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorExceptionpublic void testCacheSimple() throws Exception
Exceptionpublic void testCacheMultiThreadedSingleKey() throws Exception
Exceptionpublic void testHeapSizeChanges() throws Exception
Exceptionprivate void waitUntilFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache, org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey) throws InterruptedException
InterruptedExceptionprivate 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
InterruptedExceptionpublic void testMemoryLeak() throws Exception
Exceptionpublic void testRetrieveFromFile() throws Exception
Exceptionpublic void testBucketAllocatorLargeBuckets() throws org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException
org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorExceptionpublic void testGetPartitionSize() throws IOException
IOExceptionpublic void testValidBucketCacheConfigs() throws IOException
IOExceptionpublic void testInvalidAcceptFactorConfig() throws IOException
IOExceptionpublic void testInvalidMinFactorConfig() throws IOException
IOExceptionpublic void testInvalidExtraFreeFactorConfig() throws IOException
IOExceptionpublic void testInvalidCacheSplitFactorConfig() throws IOException
IOExceptionprivate void checkConfigValues(org.apache.hadoop.conf.Configuration conf, Map<String,float[]> configMap, boolean[] expectSuccess) throws IOException
IOExceptionprivate void validateGetPartitionSize(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache bucketCache, float partitionFactor, float minFactor)
public void testOffsetProducesPositiveOutput()
public void testCacheBlockNextBlockMetadataMissing() throws Exception
Exceptionpublic void testFreeBlockWhenIOEngineWriteFailure() throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.