You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dd...@apache.org on 2024/02/16 22:19:50 UTC
(accumulo) branch main updated (978f8b9eca -> 9f430a2695)
This is an automated email from the ASF dual-hosted git repository.
ddanielr pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
from 978f8b9eca Merge branch '2.1'
add 3298d6db89 Add Compaction Job Min & Max Wait properties (#4223)
new 9f430a2695 Merge branch '2.1'
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../org/apache/accumulo/core/conf/Property.java | 10 ++++++++++
.../accumulo/coordinator/CompactionCoordinator.java | 5 ++---
.../org/apache/accumulo/compactor/Compactor.java | 21 ++++++++++++++-------
3 files changed, 26 insertions(+), 10 deletions(-)
(accumulo) 01/01: Merge branch '2.1'
Posted by dd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ddanielr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
commit 9f430a26956449133d13c1a35c367df7ce33dc7e
Merge: 978f8b9eca 3298d6db89
Author: Daniel Roberts <dd...@gmail.com>
AuthorDate: Fri Feb 16 22:12:55 2024 +0000
Merge branch '2.1'
.../org/apache/accumulo/core/conf/Property.java | 10 ++++++++++
.../accumulo/coordinator/CompactionCoordinator.java | 5 ++---
.../org/apache/accumulo/compactor/Compactor.java | 21 ++++++++++++++-------
3 files changed, 26 insertions(+), 10 deletions(-)
diff --cc server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
index 00956edbf1,1434d2a1f1..b81c30dee3
--- a/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
+++ b/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java
@@@ -579,15 -592,17 +584,17 @@@ public class Compactor extends Abstract
protected long getWaitTimeBetweenCompactionChecks() {
// get the total number of compactors assigned to this queue
int numCompactors = ExternalCompactionUtil.countCompactors(queueName, getContext());
- // Aim for around 3 compactors checking in every second
- long sleepTime = numCompactors * 1000L / 3;
- // Ensure a compactor sleeps at least around a second
- sleepTime = Math.max(1000, sleepTime);
- // Ensure a compactor sleep not too much more than 5 mins
- sleepTime = Math.min(300_000L, sleepTime);
+ long minWait = getConfiguration().getTimeInMillis(Property.COMPACTOR_MIN_JOB_WAIT_TIME);
+ // Aim for around 3 compactors checking in per min wait time.
+ long sleepTime = numCompactors * minWait / 3;
+ // Ensure a compactor waits at least the minimum time
+ sleepTime = Math.max(minWait, sleepTime);
+ // Ensure a sleeping compactor has a configurable max sleep time
+ sleepTime = Math.min(getConfiguration().getTimeInMillis(Property.COMPACTOR_MAX_JOB_WAIT_TIME),
+ sleepTime);
// Add some random jitter to the sleep time, that averages out to sleep time. This will spread
// compactors out evenly over time.
- sleepTime = (long) (.9 * sleepTime + sleepTime * .2 * random.nextDouble());
+ sleepTime = (long) (.9 * sleepTime + sleepTime * .2 * RANDOM.get().nextDouble());
LOG.trace("Sleeping {}ms based on {} compactors", sleepTime, numCompactors);
return sleepTime;
}