keith-turner commented on code in PR #5391:
URL: https://github.com/apache/accumulo/pull/5391#discussion_r1986106913


##########
server/gc/src/main/java/org/apache/accumulo/gc/GCRun.java:
##########
@@ -368,6 +379,11 @@ public void 
deleteConfirmedCandidates(SortedMap<String,GcCandidate> confirmedDel
       };
 
       deleteThreadPool.execute(deleteTask);
+      if (timer.hasElapsed(Duration.ofMinutes(1))) {
+        log.info("Batch {} deleting file {} of {}", batchCount.get(), 
deleteCounter,

Review Comment:
   This may not give the desired progress information because these messages 
are happening as things are queued on the pool which could run very quickly.  
   
   Another way this could be done is by adding the code in the while loop that 
waits on termination and removing this code.  The following is one way to do 
this, however the cast is really sketchy and not sure it will even work.  Need 
to do the cast to get the thread pools queue.
   
   ```
         while (!deleteThreadPool.awaitTermination(1000, 
TimeUnit.MILLISECONDS)) {
           if (timer.hasElapsed(Duration.ofMinutes(1))) {
             int numRemaining = 
((ThreadPoolExecutor)deleteThreadPool).getQueue().size();
             int numProcessed = confirmedDeletes.size() - numRemaining;
             log.info("Batch {} deleting file {} of {}", batchCount.get(), 
numProcessed,
                     confirmedDeletes.size());
             timer.restart();
           }
         }
   ```



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

Reply via email to