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


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/log/LogSorter.java:
##########
@@ -292,11 +289,27 @@ void writeBuffer(String destPath, 
List<Pair<LogFileKey,LogFileValue>> buffer, in
     }
   }
 
-  public void startWatchingForRecoveryLogs(ThreadPoolExecutor 
distWorkQThreadPool)
+  /**
+   * Sort any logs that need sorting in the current thread.
+   */
+  public void sortLogsIfNeeded() throws KeeperException, InterruptedException {
+    new DistributedWorkQueue(context.getZooKeeperRoot() + Constants.ZRECOVERY, 
sortedLogConf,

Review Comment:
   Was not thinking of waiting, was just thinking of making the rate at which 
ZK is polled for recovery work consistent across server types.  Something like 
the following.
   
   ```suggestion
      if((currTime - lastCheckTime) > checkThreshold){
       // the checkThreshold exists to so that the compactor polls ZK for 
recovery work at a rate that is similar to tservers and sservers
       new DistributedWorkQueue(context.getZooKeeperRoot() + 
Constants.ZRECOVERY, sortedLogConf,....);
       lastCheckTime = currTime;
       }
   ```



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