@@ -349,6 +349,28 @@ public void testPrefetchWithDelay() throws Exception {
349349 prefetchExecutorNotifier .onConfigurationChange (conf );
350350 }
351351
352+ @ Test
353+ public void testPrefetchWhenNoBlockCache () throws Exception {
354+ PrefetchExecutorNotifier prefetchExecutorNotifier = new PrefetchExecutorNotifier (conf );
355+ try {
356+ // Set a delay to max, as we don't need to have the thread running, but rather
357+ // assert that it never gets scheduled
358+ conf .setInt (PREFETCH_DELAY , Integer .MAX_VALUE );
359+ conf .setFloat (PREFETCH_DELAY_VARIATION , 0.0f );
360+ prefetchExecutorNotifier .onConfigurationChange (conf );
361+
362+ HFileContext context = new HFileContextBuilder ().withCompression (Compression .Algorithm .GZ )
363+ .withBlockSize (DATA_BLOCK_SIZE ).build ();
364+ Path storeFile = writeStoreFile ("testPrefetchWhenNoBlockCache" , context );
365+ HFile .createReader (fs , storeFile , new CacheConfig (conf ), true , conf );
366+ assertEquals (0 , PrefetchExecutor .getPrefetchFutures ().size ());
367+ } finally {
368+ conf .setInt (PREFETCH_DELAY , 1000 );
369+ conf .setFloat (PREFETCH_DELAY_VARIATION , PREFETCH_DELAY_VARIATION_DEFAULT_VALUE );
370+ prefetchExecutorNotifier .onConfigurationChange (conf );
371+ }
372+ }
373+
352374 @ Test
353375 public void testPrefetchDoesntSkipHFileLink () throws Exception {
354376 testPrefetchWhenHFileLink (c -> {
0 commit comments