keith-turner commented on code in PR #5102:
URL: https://github.com/apache/accumulo/pull/5102#discussion_r1872060399
##########
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:
256 threads is probably ok when there is nothing else going on in the
process. It could cause problems for a process that already has a lot of
threads though.
--
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]