[ 
https://issues.apache.org/jira/browse/HIVE-23324?focusedWorklogId=462053&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-462053
 ]

ASF GitHub Bot logged work on HIVE-23324:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Jul/20 13:07
            Start Date: 22/Jul/20 13:07
    Worklog Time Spent: 10m 
      Work Description: deniskuzZ commented on a change in pull request #1275:
URL: https://github.com/apache/hive/pull/1275#discussion_r458776747



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Cleaner.java
##########
@@ -89,23 +93,28 @@ public void run() {
         handle = 
txnHandler.getMutexAPI().acquireLock(TxnStore.MUTEX_KEY.Cleaner.name());
         startedAt = System.currentTimeMillis();
         long minOpenTxnId = txnHandler.findMinOpenTxnIdForCleaner();
+        List<CompletableFuture> cleanerList = new ArrayList<>();
         for(CompactionInfo compactionInfo : txnHandler.findReadyToClean()) {
-          clean(compactionInfo, minOpenTxnId);
+          
cleanerList.add(CompletableFuture.runAsync(CompactorUtil.ThrowingRunnable.unchecked(()
 ->
+                  clean(compactionInfo, minOpenTxnId)), cleanerExecutor));
         }
+        CompletableFuture.allOf(cleanerList.toArray(new 
CompletableFuture[0])).join();
       } catch (Throwable t) {
         LOG.error("Caught an exception in the main loop of compactor cleaner, 
" +
-            StringUtils.stringifyException(t));
-      }
-      finally {
+                StringUtils.stringifyException(t));
+        if (cleanerExecutor != null) {

Review comment:
       You are submitting all tasks to the executor inside the loop at the end, 
so if there will be an exception in main loop - there won't be any running 
threads in executor.




----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 462053)
    Time Spent: 7h 40m  (was: 7.5h)

> Parallelise compaction directory cleaning process
> -------------------------------------------------
>
>                 Key: HIVE-23324
>                 URL: https://issues.apache.org/jira/browse/HIVE-23324
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Marton Bod
>            Assignee: Adesh Kumar Rao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 7h 40m
>  Remaining Estimate: 0h
>
> Initiator processes the various compaction candidates in parallel, so we 
> could follow a similar approach in Cleaner where we currently clean the 
> directories sequentially.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to