milleruntime commented on a change in pull request #2263:
URL: https://github.com/apache/accumulo/pull/2263#discussion_r705293998
##########
File path:
server/tserver/src/main/java/org/apache/accumulo/tserver/compactions/CompactionService.java
##########
@@ -223,15 +224,22 @@ private boolean reconcile(Set<CompactionJob> jobs,
Collection<SubmittedJob> subm
return true;
}
- public void compact(CompactionKind kind, Compactable compactable,
+ /**
+ * Get compaction plan for the provided compactable tablet and possibly
submit for compaction.
+ * Plans get added to the planning queue before calling the planningExecutor
to get the plan. If
+ * no files are selected, return. Otherwise, submit the compaction job.
+ */
+ public void submitCompaction(CompactionKind kind, Compactable compactable,
Consumer<Compactable> completionCallback) {
Objects.requireNonNull(compactable);
+ // add tablet to planning queue and use planningExecutor to get the plan
if (queuedForPlanning.get(kind).putIfAbsent(compactable.getExtent(),
compactable) == null) {
try {
planningExecutor.execute(() -> {
try {
- planCompaction(kind, compactable, completionCallback);
+ Optional<CompactionPlan> plan = getCompactionPlan(kind,
compactable);
+ plan.ifPresent(cp -> submitCompactionJob(cp, compactable,
completionCallback));
Review comment:
Thanks. I like this better. I thought getting the files was part of
getting the plan but it looks like the plan is more about the jobs.
--
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]