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
-
Field Summary
Modifier and TypeFieldDescription(package private) final int
(package private) org.apache.hadoop.hbase.io.hfile.bucket.BucketCache
(package private) final int
(package private) final long
static final HBaseClassTestRule
int
int[]
private static final HBaseTestingUtility
private String
(package private) final int
(package private) final int
(package private) final int
(package private) final int
(package private) final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate 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) private void
checkConfigValues
(org.apache.hadoop.conf.Configuration conf, Map<String, float[]> configMap, boolean[] expectSuccess) private org.apache.hadoop.fs.Path
Test Utility to create test dir and return namedata()
private static <T> T
Return a random element froma
.void
setup()
void
tearDown()
void
void
void
void
void
void
void
void
void
void
This test is for HBASE-26295,BucketEntry
which is restored from a persistence file could not be freed even if correspondingHFileBlock
is evicted fromBucketCache
.void
void
void
void
void
void
void
void
void
private void
testRetrievalUtils
(org.apache.hadoop.fs.Path testDir, String ioEngineName) void
void
void
void
void
void
void
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)
-
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:
IOException
InterruptedException
-
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,BucketEntry
which is restored from a persistence file could not be freed even if correspondingHFileBlock
is evicted fromBucketCache
.- Throws:
Exception
-
testBlockAdditionWaitWhenCache
- Throws:
Exception
-