You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/07/21 20:14:31 UTC

[GitHub] [hive] belugabehr edited a comment on pull request #1275: HIVE-23324: Parallelise compaction directory cleaning process

belugabehr edited a comment on pull request #1275:
URL: https://github.com/apache/hive/pull/1275#issuecomment-662082780


   Void type:
   
   ```
     public static void main(String[] args) throws IOException
     {
   
       ExecutorService service = Executors.newFixedThreadPool(2);
       CompletionService<Void> completionService = new ExecutorCompletionService<>(service);
   
       for (int i = 0; i < 10; i++)
       {
         final int t = i;
         completionService.submit(() -> {
           clean("File" + t);
           return null;
         });
       }
   
       for (int i = 0; i < 10; ++i) {
         try {
             completionService.take().get();
         } catch (Exception ignore) {}
     }
     }
   
     public static String clean(String path)
     {
       return "Cleaned: " + path;
     }
   ```


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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org