Skip to content

Commit 2d49897

Browse files
author
sairampola
committed
Update BucketCache initialization in TestVerifyBucketCacheFile to include DEFAULT_ERROR_TOLERATION_DURATION and configuration parameters. This change enhances error handling and ensures consistent cache restoration behavior during tests.
1 parent 6de25b8 commit 2d49897

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestVerifyBucketCacheFile.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ public void testRetrieveFromFile() throws Exception {
103103
BucketCache bucketCache = null;
104104
BucketCache recoveredBucketCache = null;
105105
try {
106-
bucketCache =
107-
new BucketCache("file:" + testDir + "/bucket.cache", capacitySize, constructedBlockSize,
108-
constructedBlockSizes, writeThreads, writerQLen, testDir + "/bucket.persistence");
106+
bucketCache = new BucketCache("file:" + testDir + "/bucket.cache", capacitySize,
107+
constructedBlockSize, constructedBlockSizes, writeThreads, writerQLen,
108+
testDir + "/bucket.persistence", DEFAULT_ERROR_TOLERATION_DURATION, conf);
109109
assertTrue(bucketCache.waitForCacheInitialization(10000));
110110
long usedSize = bucketCache.getAllocator().getUsedSize();
111111
assertEquals(0, usedSize);
@@ -121,9 +121,9 @@ public void testRetrieveFromFile() throws Exception {
121121
// 1.persist cache to file
122122
bucketCache.shutdown();
123123
// restore cache from file
124-
bucketCache =
125-
new BucketCache("file:" + testDir + "/bucket.cache", capacitySize, constructedBlockSize,
126-
constructedBlockSizes, writeThreads, writerQLen, testDir + "/bucket.persistence");
124+
bucketCache = new BucketCache("file:" + testDir + "/bucket.cache", capacitySize,
125+
constructedBlockSize, constructedBlockSizes, writeThreads, writerQLen,
126+
testDir + "/bucket.persistence", DEFAULT_ERROR_TOLERATION_DURATION, conf);
127127
assertTrue(bucketCache.waitForCacheInitialization(10000));
128128
assertEquals(usedSize, bucketCache.getAllocator().getUsedSize());
129129
// persist cache to file
@@ -134,9 +134,9 @@ public void testRetrieveFromFile() throws Exception {
134134
FileSystems.getDefault().getPath(testDir.toString(), "bucket.cache");
135135
assertTrue(Files.deleteIfExists(cacheFile));
136136
// can't restore cache from file
137-
recoveredBucketCache =
138-
new BucketCache("file:" + testDir + "/bucket.cache", capacitySize, constructedBlockSize,
139-
constructedBlockSizes, writeThreads, writerQLen, testDir + "/bucket.persistence");
137+
recoveredBucketCache = new BucketCache("file:" + testDir + "/bucket.cache", capacitySize,
138+
constructedBlockSize, constructedBlockSizes, writeThreads, writerQLen,
139+
testDir + "/bucket.persistence", DEFAULT_ERROR_TOLERATION_DURATION, conf);
140140
assertTrue(recoveredBucketCache.waitForCacheInitialization(10000));
141141
waitPersistentCacheValidation(conf, recoveredBucketCache);
142142
assertEquals(0, recoveredBucketCache.getAllocator().getUsedSize());

0 commit comments

Comments
 (0)