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 Summary
Nested Classes -
Field Summary
FieldsModifier 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 Summary
Constructors -
Method Summary
Modifier 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
-
cache
org.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
-
TestBucketCache
public TestBucketCache()
-
-
Method Details
-
data
-
setup
- Throws:
IOException
-
tearDown
-
createAndGetTestDir
Test Utility to create test dir and return name- Returns:
- return name of created dir
- Throws:
IOException- throws IOException
-
randFrom
Return a random element froma. -
testBucketAllocator
public 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
-
waitUntilFlushedToBucket
public static void waitUntilFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache, org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey) throws InterruptedException - Throws:
InterruptedException
-
waitUntilAllFlushedToBucket
public static void waitUntilAllFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache) throws InterruptedException - Throws:
InterruptedException
-
cacheAndWaitUntilFlushedToBucket
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, boolean waitWhenCache) throws InterruptedException - Throws:
InterruptedException
-
testMemoryLeak
- Throws:
Exception
-
testRetrieveFromFile
- Throws:
Exception
-
testRetrieveFromMMap
- Throws:
Exception
-
testRetrieveFromPMem
- Throws:
Exception
-
testRetrievalUtils
private void testRetrievalUtils(org.apache.hadoop.fs.Path testDir, String ioEngineName) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
testRetrieveUnsupportedIOE
- Throws:
Exception
-
testRetrieveFromMultipleFiles
- Throws:
Exception
-
testRetrieveFromFileWithoutPersistence
- Throws:
Exception
-
testBucketAllocatorLargeBuckets
public 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
-
checkConfigValues
private void checkConfigValues(org.apache.hadoop.conf.Configuration conf, Map<String, float[]> configMap, boolean[] expectSuccess) throws IOException- Throws:
IOException
-
validateGetPartitionSize
private 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
-
testFreeBucketEntryRestoredFromFile
This 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
-