sumitagrawl commented on code in PR #9390:
URL: https://github.com/apache/ozone/pull/9390#discussion_r2591852435


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/BackgroundTask.java:
##########
@@ -18,16 +18,56 @@
 package org.apache.hadoop.hdds.utils;
 
 import java.util.concurrent.Callable;
+import java.util.concurrent.RecursiveTask;
 
 /**
  * A task thread to run by {@link BackgroundService}.
  */
-public interface BackgroundTask extends Callable<BackgroundTaskResult> {
+public abstract class BackgroundTask extends 
RecursiveTask<BackgroundTask.BackgroundTaskForkResult>

Review Comment:
   We can do like below, please check... BackgroundTaskForkJoin will not be 
exposed.
   ```
   public class BackgroundTaskForkJoin extends 
RecursiveTask<BackgroundTaskForkJoin.BackgroundTaskForkResult> {
     private static final long serialVersionUID = 1L;
     private final transient BackgroundTask backgroundTask;
     
     public BackgroundTaskForkJoin(BackgroundTask backgroundTask) {
       this.backgroundTask = backgroundTask;
     }
     
     public static class BackgroundTaskForkResult {
       ...
     }
   }
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to