You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2020/11/04 00:00:31 UTC
[accumulo] branch main updated: Minor comment wording improvement
This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new d7ca701 Minor comment wording improvement
d7ca701 is described below
commit d7ca701f62e15d17a29be8f629a3c8cce826da37
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Tue Nov 3 18:59:37 2020 -0500
Minor comment wording improvement
Improve comment wording for CompactionExecutor added in #1609 and merged
with #1629
---
.../accumulo/tserver/compactions/CompactionExecutor.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionExecutor.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionExecutor.java
index d30585a..aaa0232 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionExecutor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionExecutor.java
@@ -55,8 +55,8 @@ public class CompactionExecutor {
private ThreadPoolExecutor rawExecutor;
// This exist to provide an accurate count of queued compactions for metrics. The PriorityQueue is
- // not used because it size may be off because it contains cancelled compactions. The collection
- // below should not contain cancelled compactions. A conncurrent set was not used because those do
+ // not used because its size may be off due to it containing cancelled compactions. The collection
+ // below should not contain cancelled compactions. A concurrent set was not used because those do
// not have constant time size operations.
private Set<CompactionTask> queuedTask = Collections.synchronizedSet(new HashSet<>());
@@ -116,9 +116,9 @@ public class CompactionExecutor {
queuedTask.remove(this);
if (canceled && cancelCount.incrementAndGet() % 1024 == 0) {
- // Need to occasionally clean the queue which could have canceled task with low priority
- // that hang around. Avoid cleaning the queue every time something is canceled as that could
- // be expensive.
+ // Occasionally clean the queue of canceled tasks that have hung around because of their low
+ // priority. This runs periodically, instead of every time something is canceled, to avoid
+ // hurting performance.
queue.removeIf(runnable -> ((CompactionTask) runnable).getStatus() == Status.CANCELED);
}