cshannon commented on code in PR #4980:
URL: https://github.com/apache/accumulo/pull/4980#discussion_r1802139636
##########
server/manager/src/main/java/org/apache/accumulo/manager/compaction/queue/CompactionJobPriorityQueue.java:
##########
@@ -138,6 +150,10 @@ public CompactionJobPriorityQueue(CompactorGroupId
groupId, int maxSize) {
this.rejectedJobs = new AtomicLong(0);
this.dequeuedJobs = new AtomicLong(0);
this.futures = new ArrayDeque<>();
+ this.jobAges = new ConcurrentHashMap<>();
Review Comment:
I made it a ConcurrentHashMap() because of CompactionJobPriorityQueueStats
iterates over jobAges to build the stats. It's memoized but it's accessible
publically so I was thinking another thread could call to get the metrics and
you could end up iterating over the map to build the stats outside the lock.
--
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]