Skip to content

Commit 54331cb

Browse files
committed
adding hbase.bucketcache.queue.addition.waittime in TestBucketCache.testBlockAdditionWaitWhenCache,
as it is now, it's not really waiting for caching to complete Change-Id: Ibe3669dcae881615682db9f490170f8d1429e357
1 parent 8f9b040 commit 54331cb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ protected enum CacheState {
283283
"hbase.bucketcache.persistent.file.integrity.check.algorithm";
284284
private static final String DEFAULT_FILE_VERIFY_ALGORITHM = "MD5";
285285

286-
private static final String QUEUE_ADDITION_WAIT_TIME =
286+
public static final String QUEUE_ADDITION_WAIT_TIME =
287287
"hbase.bucketcache.queue.addition.waittime";
288288
private static final long DEFAULT_QUEUE_ADDITION_WAIT_TIME = 0;
289289
private long queueAdditionWaitTime;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.BLOCK_ORPHAN_GRACE_PERIOD;
2222
import static org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.EXTRA_FREE_FACTOR_CONFIG_NAME;
2323
import static org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.MIN_FACTOR_CONFIG_NAME;
24+
import static org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.QUEUE_ADDITION_WAIT_TIME;
2425
import static org.junit.Assert.assertEquals;
2526
import static org.junit.Assert.assertFalse;
2627
import static org.junit.Assert.assertNotEquals;
@@ -865,6 +866,9 @@ public void testBlockAdditionWaitWhenCache() throws Exception {
865866
String ioEngineName = "file:" + dataTestDir + "/bucketNoRecycler.cache";
866867
String persistencePath = dataTestDir + "/bucketNoRecycler.persistence";
867868

869+
Configuration config = HBASE_TESTING_UTILITY.getConfiguration();
870+
config.setLong(QUEUE_ADDITION_WAIT_TIME, 1000);
871+
868872
bucketCache = new BucketCache(ioEngineName, capacitySize, constructedBlockSize,
869873
constructedBlockSizes, 1, 1, persistencePath);
870874
assertTrue(bucketCache.waitForCacheInitialization(10000));

0 commit comments

Comments
 (0)