kabhishek4 commented on code in PR #5605:
URL: https://github.com/apache/hbase/pull/5605#discussion_r1486302702


##########
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestPrefetch.java:
##########
@@ -298,6 +299,44 @@ public void testPrefetchDoesntSkipRefs() throws Exception {
     });
   }
 
+  @Test
+  public void testOnConfigurationChange() {
+    // change PREFETCH_DELAY_ENABLE_KEY from false to true
+    conf.setInt(PREFETCH_DELAY, 40000);
+    PrefetchExecutor.loadConfiguration(conf);
+    assertTrue(getPrefetchDelay() == 40000);
+
+    // restore
+    conf.setInt(PREFETCH_DELAY, 30000);
+    PrefetchExecutor.loadConfiguration(conf);
+    assertTrue(getPrefetchDelay() == 30000);
+
+  }
+
+  @Test
+  public void testPrefetchWithDelay() throws Exception {
+    conf.setInt(PREFETCH_DELAY, 40000);
+    PrefetchExecutor.loadConfiguration(conf);
+
+    HFileContext context = new 
HFileContextBuilder().withCompression(Compression.Algorithm.GZ)
+      .withBlockSize(DATA_BLOCK_SIZE).build();
+    Path storeFile = writeStoreFile("TestPrefetchWithDelay", context);
+    readStoreFile(storeFile);
+    assertTrue(getPrefetchDelay() == 40000);
+  }
+
+  @Test
+  public void testPrefetchWithDefaultDelay() throws Exception {
+    conf.setInt(PREFETCH_DELAY, 1000);

Review Comment:
   Default value if is 1000 sec also, value less than 50 results in below 
failure 
   
   java.lang.AssertionError
       at org.junit.Assert.fail(Assert.java:87)
       at org.junit.Assert.assertTrue(Assert.java:42)
       at org.junit.Assert.assertTrue(Assert.java:53)
       at 
org.apache.hadoop.hbase.io.hfile.TestPrefetch.lambda$readStoreFile$4(TestPrefetch.java:238)
       at 
org.apache.hadoop.hbase.io.hfile.TestPrefetch.readStoreFile(TestPrefetch.java:289)
       



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to