dlmarion commented on code in PR #4767:
URL: https://github.com/apache/accumulo/pull/4767#discussion_r1695447822
##########
server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java:
##########
@@ -1070,21 +1071,30 @@ private void cleanUpCompactors() {
var groups = zoorw.getChildren(compactorQueuesPath);
for (String group : groups) {
- String qpath = compactorQueuesPath + "/" + group;
-
- var compactors = zoorw.getChildren(qpath);
+ final String qpath = compactorQueuesPath + "/" + group;
+ final CompactorGroupId cgid = CompactorGroupId.of(group);
+ final var compactors = zoorw.getChildren(qpath);
if (compactors.isEmpty()) {
deleteEmpty(zoorw, qpath);
- }
-
- for (String compactor : compactors) {
- String cpath = compactorQueuesPath + "/" + group + "/" + compactor;
- var lockNodes = zoorw.getChildren(compactorQueuesPath + "/" + group
+ "/" + compactor);
- if (lockNodes.isEmpty()) {
- deleteEmpty(zoorw, cpath);
+ // Group has no compactors, we can clear its
+ // associated priority queue of jobs
+ getJobQueues().getQueue(cgid).clear();
+ } else {
+ int aliveCompactorsForGroup = 0;
+ for (String compactor : compactors) {
+ String cpath = compactorQueuesPath + "/" + group + "/" + compactor;
+ var lockNodes = zoorw.getChildren(compactorQueuesPath + "/" +
group + "/" + compactor);
+ if (lockNodes.isEmpty()) {
+ deleteEmpty(zoorw, cpath);
+ } else {
+ aliveCompactorsForGroup++;
+ }
}
+ getJobQueues().getQueue(cgid).setMaxSize(
+ Math.min((int) (aliveCompactorsForGroup * queueSizeFactor),
Integer.MAX_VALUE));
Review Comment:
Handled NPE in 18d2243
##########
server/manager/src/main/java/org/apache/accumulo/manager/compaction/queue/CompactionJobPriorityQueue.java:
##########
@@ -304,4 +309,8 @@ private CjpqKey addJobToQueue(TabletMetadata
tabletMetadata, CompactionJob job)
jobQueue.put(key, new CompactionJobQueues.MetaJob(job, tabletMetadata));
return key;
}
+
+ public synchronized void clear() {
+ jobQueue.clear();
Review Comment:
Cleared tabletJobs in 18d2243
--
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]