Class TestBucketCache
java.lang.Object
org.apache.hadoop.hbase.io.hfile.bucket.TestBucketCache
Basic test of BucketCache.Puts and gets.
 
Tests will ensure that blocks' data correctness under several threads concurrency
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescription(package private) final int(package private) org.apache.hadoop.hbase.io.hfile.bucket.BucketCache(package private) final int(package private) final longstatic final HBaseClassTestRuleintint[]private static final HBaseTestingUtilityprivate String(package private) final int(package private) final int(package private) final int(package private) final int(package private) final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate voidcacheAndWaitUntilFlushedToBucket(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, boolean waitWhenCache) private voidcheckConfigValues(org.apache.hadoop.conf.Configuration conf, Map<String, float[]> configMap, boolean[] expectSuccess) private org.apache.hadoop.fs.PathTest Utility to create test dir and return namedata()private static <T> TReturn a random element froma.voidsetup()voidtearDown()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidThis test is for HBASE-26295,BucketEntrywhich is restored from a persistence file could not be freed even if correspondingHFileBlockis evicted fromBucketCache.voidvoidvoidvoidvoidvoidvoidvoidvoidprivate voidtestRetrievalUtils(org.apache.hadoop.fs.Path testDir, String ioEngineName) voidvoidvoidvoidvoidvoidvoidprivate voidvalidateGetPartitionSize(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache bucketCache, float partitionFactor, float minFactor) static voidwaitUntilAllFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache) static voidwaitUntilFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache, org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey) 
- 
Field Details- 
CLASS_RULE
- 
constructedBlockSize
- 
constructedBlockSizes
- 
cacheorg.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache
- 
CACHE_SIZE- See Also:
 
- 
NUM_BLOCKS- See Also:
 
- 
BLOCK_SIZE- See Also:
 
- 
NUM_THREADS- See Also:
 
- 
NUM_QUERIES- See Also:
 
- 
capacitySize- See Also:
 
- 
writeThreads- See Also:
 
- 
writerQLen- See Also:
 
- 
ioEngineName
- 
HBASE_TESTING_UTILITY
 
- 
- 
Constructor Details- 
TestBucketCachepublic TestBucketCache()
 
- 
- 
Method Details- 
data
- 
setup- Throws:
- IOException
 
- 
tearDown
- 
createAndGetTestDirTest Utility to create test dir and return name- Returns:
- return name of created dir
- Throws:
- IOException- throws IOException
 
- 
randFromReturn a random element froma.
- 
testBucketAllocatorpublic void testBucketAllocator() throws org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException- Throws:
- org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException
 
- 
testCacheSimple- Throws:
- Exception
 
- 
testCacheMultiThreadedSingleKey- Throws:
- Exception
 
- 
testHeapSizeChanges- Throws:
- Exception
 
- 
waitUntilFlushedToBucketpublic static void waitUntilFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache, org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey) throws InterruptedException - Throws:
- InterruptedException
 
- 
waitUntilAllFlushedToBucketpublic static void waitUntilAllFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache) throws InterruptedException - Throws:
- InterruptedException
 
- 
cacheAndWaitUntilFlushedToBucketprivate 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, boolean waitWhenCache) throws InterruptedException - Throws:
- InterruptedException
 
- 
testMemoryLeak- Throws:
- Exception
 
- 
testRetrieveFromFile- Throws:
- Exception
 
- 
testRetrieveFromMMap- Throws:
- Exception
 
- 
testRetrieveFromPMem- Throws:
- Exception
 
- 
testRetrievalUtilsprivate void testRetrievalUtils(org.apache.hadoop.fs.Path testDir, String ioEngineName) throws IOException, InterruptedException - Throws:
- IOException
- InterruptedException
 
- 
testRetrieveUnsupportedIOE- Throws:
- Exception
 
- 
testRetrieveFromMultipleFiles- Throws:
- Exception
 
- 
testRetrieveFromFileWithoutPersistence- Throws:
- Exception
 
- 
testBucketAllocatorLargeBucketspublic void testBucketAllocatorLargeBuckets() throws org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException- Throws:
- org.apache.hadoop.hbase.io.hfile.bucket.BucketAllocatorException
 
- 
testGetPartitionSize- Throws:
- IOException
 
- 
testCacheSizeCapacity- Throws:
- IOException
 
- 
testValidBucketCacheConfigs- Throws:
- IOException
 
- 
testInvalidAcceptFactorConfig- Throws:
- IOException
 
- 
testInvalidMinFactorConfig- Throws:
- IOException
 
- 
testInvalidExtraFreeFactorConfig- Throws:
- IOException
 
- 
testInvalidCacheSplitFactorConfig- Throws:
- IOException
 
- 
checkConfigValuesprivate void checkConfigValues(org.apache.hadoop.conf.Configuration conf, Map<String, float[]> configMap, boolean[] expectSuccess) throws IOException- Throws:
- IOException
 
- 
validateGetPartitionSizeprivate void validateGetPartitionSize(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache bucketCache, float partitionFactor, float minFactor) 
- 
testOffsetProducesPositiveOutput
- 
testEvictionCount- Throws:
- InterruptedException
 
- 
testCacheBlockNextBlockMetadataMissing- Throws:
- Exception
 
- 
testRAMCache
- 
testFreeBlockWhenIOEngineWriteFailure- Throws:
- IOException
 
- 
testFreeBucketEntryRestoredFromFileThis test is for HBASE-26295,BucketEntrywhich is restored from a persistence file could not be freed even if correspondingHFileBlockis evicted fromBucketCache.- Throws:
- Exception
 
- 
testBlockAdditionWaitWhenCache- Throws:
- Exception
 
 
-