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/09/01 03:44:58 UTC

[GitHub] [hbase] openinx commented on a change in pull request #549: HBASE-22912 [Backport] HBASE-22867 to branch-1 to avoid ForkJoinPool to spawn thousands of threads

openinx commented on a change in pull request #549: HBASE-22912 [Backport] HBASE-22867 to branch-1 to avoid ForkJoinPool to spawn thousands of threads
URL: https://github.com/apache/hbase/pull/549#discussion_r319742685
 
 

 ##########
 File path: hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
 ##########
 @@ -322,140 +330,154 @@ public boolean getEnabled() {
     T act() throws IOException;
   }
 
-  /**
-   * Attemps to clean up a directory, its subdirectories, and files. Return value is true if
-   * everything was deleted. false on partial / total failures.
-   */
-  private final class CleanerTask extends RecursiveTask<Boolean> {
-    private static final long serialVersionUID = -1584635903138015418L;
-    private final Path dir;
-    private final boolean root;
+  private interface Callback {
+    void run(boolean val);
+  }
 
-    CleanerTask(final FileStatus dir, final boolean root) {
-      this(dir.getPath(), root);
+  private final class AsyncResult {
+
+    private Callback callback;
+    private boolean result;
+    private boolean resultSet = false;
+
+    AsyncResult(Callback callback) {
 
 Review comment:
   > The same question, can AsyncResult be generic?
   
   ditto
   
   >  Looks like AsyncResult and Callback should be designed together, but now they are separated.
   
   In the root dir case, we don't need to call callback to remove the current dir, while for the non-root dir case, we must register a callback to remove the current dir  if all the subdirs & files are deleted. So the AsyncResult & Callback should have different meaning, one to get the result async, another to execute the removing logics once all subdirs & files are deleted.

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