You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2019/06/24 17:43:53 UTC

[GitHub] [hbase] saintstack commented on a change in pull request #333: [HBASE-22606] : BucketCache additional tests

saintstack commented on a change in pull request #333: [HBASE-22606] : BucketCache additional tests
URL: https://github.com/apache/hbase/pull/333#discussion_r296837381
 
 

 ##########
 File path: hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/bucket/TestBucketCache.java
 ##########
 @@ -258,17 +257,52 @@ public void testRetrieveFromFile() throws Exception {
     HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
     Path testDir = TEST_UTIL.getDataTestDir();
     TEST_UTIL.getTestFileSystem().mkdirs(testDir);
-
     String ioEngineName = "file:" + testDir + "/bucket.cache";
+    testRetrievalUtils(testDir, ioEngineName);
+    int[] smallBucketSizes = new int[]{3 * 1024, 5 * 1024};
     String persistencePath = testDir + "/bucket.persistence";
+    BucketCache bucketCache = new BucketCache(ioEngineName, capacitySize, constructedBlockSize,
+            smallBucketSizes, writeThreads, writerQLen, persistencePath);
+    assertFalse(new File(persistencePath).exists());
+    assertEquals(0, bucketCache.getAllocator().getUsedSize());
+    assertEquals(0, bucketCache.backingMap.size());
+    TEST_UTIL.cleanupTestDir();
+  }
 
+  @Test
+  public void testRetrieveFromMMap() throws Exception {
+    HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
 
 Review comment:
   Do we get a new HBaseTestingUtility per test? If so, why not in the test setup  rather than at head of each test?
   Also CAPITALIZATION of variables is for statics, not locals as here. 
   
   Make a data member named testUtil and create the HTU instance in the @Before ?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services