Class TestVerifyBucketCacheFile
java.lang.Object
org.apache.hadoop.hbase.io.hfile.bucket.TestVerifyBucketCacheFile
Basic test for check file's integrity before start BucketCache in fileIOEngine
-
Field Summary
Modifier and TypeFieldDescription(package private) final long
static final HBaseClassTestRule
int
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) data()
void
When using persistent bucket cache, there may be crashes between persisting the backing map and syncing new blocks to the cache file itself, leading to an inconsistent state between the cache keys and the cached data.private void
testChunkedBackingMapRecovery
(int chunkSize, int numBlocks) void
void
Test whether BucketCache is started normally after modifying the cache file.void
Test whether BucketCache is started normally after modifying the cache file's last modified time.void
void
Test cache file or persistence file does not exist whether BucketCache starts normally (1) Start BucketCache and add some blocks, then shutdown BucketCache and persist cache to file.void
void
private 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
-
capacitySize
- See Also:
-
writeThreads
- See Also:
-
writerQLen
- See Also:
-
-
Constructor Details
-
TestVerifyBucketCacheFile
public TestVerifyBucketCacheFile()
-
-
Method Details
-
data
-
testRetrieveFromFile
Test cache file or persistence file does not exist whether BucketCache starts normally (1) Start BucketCache and add some blocks, then shutdown BucketCache and persist cache to file. Restart BucketCache and it can restore cache from file. (2) Delete bucket cache file after shutdown BucketCache. Restart BucketCache and it can't restore cache from file, the cache file and persistence file would be deleted before BucketCache start normally. (3) Delete persistence file after shutdown BucketCache. Restart BucketCache and it can't restore cache from file, the cache file and persistence file would be deleted before BucketCache start normally.- Throws:
Exception
- the exception
-
testRetrieveFromFileAfterDelete
- Throws:
Exception
-
testModifiedBucketCacheFileData
Test whether BucketCache is started normally after modifying the cache file. Start BucketCache and add some blocks, then shutdown BucketCache and persist cache to file. Restart BucketCache after modify cache file's data, and it can't restore cache from file, the cache file and persistence file would be deleted before BucketCache start normally.- Throws:
Exception
- the exception
-
testModifiedBucketCacheFileTime
Test whether BucketCache is started normally after modifying the cache file's last modified time. First Start BucketCache and add some blocks, then shutdown BucketCache and persist cache to file. Then Restart BucketCache after modify cache file's last modified time. HBASE-XXXX has modified persistence cache such that now we store extra 8 bytes at the end of each block in the cache, representing the nanosecond time the block has been cached. So in the event the cache file has failed checksum verification during loading time, we go through all the cached blocks in the cache map and validate the cached time long between what is in the map and the cache file. If that check fails, we pull the cache key entry out of the map. Since in this test we are only modifying the access time to induce a checksum error, the cache file content is still valid and the extra verification should validate that all cache keys in the map are still recoverable from the cache.- Throws:
Exception
- the exception
-
testBucketCacheRecovery
When using persistent bucket cache, there may be crashes between persisting the backing map and syncing new blocks to the cache file itself, leading to an inconsistent state between the cache keys and the cached data. This is to make sure the cache keys are updated accordingly, and the keys that are still valid do succeed in retrieve related block data from the cache without any corruption.- Throws:
Exception
- the exception
-
testSingleChunk
- Throws:
Exception
-
testCompletelyFilledChunks
- Throws:
Exception
-
testPartiallyFilledChunks
- Throws:
Exception
-
testChunkedBackingMapRecovery
- Throws:
Exception
-
waitUntilFlushedToBucket
private void waitUntilFlushedToBucket(org.apache.hadoop.hbase.io.hfile.bucket.BucketCache cache, org.apache.hadoop.hbase.io.hfile.BlockCacheKey cacheKey) 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) throws InterruptedException - Throws:
InterruptedException
-