dlmarion commented on code in PR #5102:
URL: https://github.com/apache/accumulo/pull/5102#discussion_r1869912031


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/InstanceOperationsImpl.java:
##########
@@ -404,19 +386,34 @@ public List<ActiveCompaction> getActiveCompactions()
   @Override
   public List<ActiveCompaction> getActiveCompactions(Collection<ServerId> 
compactionServers)
       throws AccumuloException, AccumuloSecurityException {
+    return queryServers(compactionServers, this::getActiveCompactions,
+        INSTANCE_OPS_COMPACTIONS_FINDER_POOL);
+  }
+
+  private <T> List<T> queryServers(Collection<ServerId> servers, 
ServerQuery<List<T>> serverQuery,
+      ThreadPoolNames pool) throws AccumuloException, 
AccumuloSecurityException {
+
+    final ExecutorService executorService;
+    // If size 0 or 1 there's no need to create a thread pool
+    if (servers.isEmpty()) {
+      return List.of();
+    } else if (servers.size() == 1) {
+      executorService = MoreExecutors.newDirectExecutorService();
+    } else {
+      int numThreads = Math.max(4, Math.min((servers.size()) / 10, 256));

Review Comment:
   ok, I didn't realize that we were already doing this.



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