ankitsinghal commented on code in PR #5605: URL: https://github.com/apache/hbase/pull/5605#discussion_r1479243204
########## hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/PrefetchExecutor.java: ########## @@ -134,4 +139,25 @@ private PrefetchExecutor() { static ScheduledExecutorService getExecutorPool() { return prefetchExecutorPool; } + + public static int getPrefetchDelay() { + return prefetchDelayMillis; + } + + @Override + public void onConfigurationChange(Configuration conf) { + PrefetchExecutor.loadConfiguration(conf); + } + + @Override + public void registerChildren(ConfigurationManager manager) { + } + + @Override + public void deregisterChildren(ConfigurationManager manager) { + } + + public static void loadConfiguration(Configuration conf) { + prefetchDelayMillis = conf.getInt(PREFETCH_DELAY, 1000); Review Comment: To avoid unnecessary cost of cancelling a task that has already spent a lot of time, it's important to first check the time remaining for the task with `schedFuture.getDelay(TimeUnit.MINUTES)`. This will tell you whether the task has already started or not, allowing you to cancel and trigger it again only if necessary. -- 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: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org