wchevreuil commented on a change in pull request #324: [HBASE-22606] :
BucketCache improvement with additional tests
URL: https://github.com/apache/hbase/pull/324#discussion_r295830082
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestBucketCache.java
##########
@@ -270,28 +287,63 @@ public void testRetrieveFromFile() throws Exception {
}
usedSize = bucketCache.getAllocator().getUsedSize();
assertNotEquals(0, usedSize);
- // persist cache to file
bucketCache.shutdown();
assertTrue(new File(persistencePath).exists());
-
- // restore cache from file
bucketCache = new BucketCache(ioEngineName, capacitySize,
constructedBlockSize,
- constructedBlockSizes, writeThreads, writerQLen, persistencePath);
+ constructedBlockSizes, writeThreads, writerQLen, persistencePath);
assertFalse(new File(persistencePath).exists());
assertEquals(usedSize, bucketCache.getAllocator().getUsedSize());
- // persist cache to file
bucketCache.shutdown();
assertTrue(new File(persistencePath).exists());
+ int[] smallBucketSizes = new int[]{2 * 1024 + 1024, 4 * 1024 + 1024};
Review comment:
Why not "new int[]{3 * 1024, 5 * 1024 };", instead? Would be easier to read,
IMO. Also, I would think this and next 4 lines would be worth place on its own
test method, since it's validating extra scenario where when bucket cache is
instantiated with smaller bucket sizes, it can't read previously saved buckets.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services