Moved map containing long running compactions to Monitor#6223
Moved map containing long running compactions to Monitor#6223dlmarion wants to merge 12 commits intoapache:mainfrom
Conversation
server/monitor/src/main/java/org/apache/accumulo/monitor/next/InformationFetcher.java
Outdated
Show resolved
Hide resolved
server/monitor/src/main/java/org/apache/accumulo/monitor/next/InformationFetcher.java
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java
Outdated
Show resolved
Hide resolved
server/monitor/src/main/java/org/apache/accumulo/monitor/next/Endpoints.java
Outdated
Show resolved
Hide resolved
server/monitor/src/main/java/org/apache/accumulo/monitor/next/Endpoints.java
Outdated
Show resolved
Hide resolved
…Endpoints.java Co-authored-by: Dom G. <[email protected]>
…Endpoints.java Co-authored-by: Dom G. <[email protected]>
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| public class RunningCompactionInfo { |
There was a problem hiding this comment.
@DomGarguilo - is there a difference between this class and RunningCompactionsSummary?
| var futureIter = rcFutures.iterator(); | ||
| while (futureIter.hasNext()) { | ||
| var future = futureIter.next(); | ||
| if (Thread.currentThread().isInterrupted()) { |
There was a problem hiding this comment.
If the thread is interrupted, then the sleep later in the code may throw an exception, if that does happen then would not get through the entire list. Also, its possible other java code could throw an exception if the thread is interrupted. Like maybe future.get() would thrown exception.
Maybe could catch interrupted exception and then zip through an cancel everything and then rethrow it?
| @@ -330,7 +298,7 @@ public void run() { | |||
| ThreadPools.resizePool(pool, () -> Math.max(20, (futures.size() / 20)), poolName); | |||
|
|
|||
| // Fetch external compaction information from the Manager | |||
There was a problem hiding this comment.
Comment needs an update
| @SuppressWarnings("unused") | ||
| List<ServerId> failures = ExternalCompactionUtil.getCompactionsRunningOnCompactors(this.ctx, | ||
| executor, (t) -> running.add(t)); | ||
| executor.shutdownNow(); |
There was a problem hiding this comment.
Would be good to put this shutdown in a finally block so threads are not leaked if there is an exception.
In Java 21 executors are closeable, that will be nice to use eventually.
| while (futureIter.hasNext()) { | ||
| var future = futureIter.next(); | ||
| future.cancel(true); | ||
| futureIter.remove(); |
There was a problem hiding this comment.
This remove does not seem needed and its expensive, it will keep shifting everything in the array list over by one. If the remove is needed then using a list iterator and going backwards may be more efficient because that would keep removing the last instead of the first.
No description provided.