This is an automated email from the ASF dual-hosted git repository. kturner pushed a commit to branch elasticity in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/elasticity by this push: new 016dda7ffe removes selector compactions (#4397) 016dda7ffe is described below commit 016dda7ffe6f67a096af38a9e6f23133747c7c2c Author: Keith Turner <ktur...@apache.org> AuthorDate: Wed Apr 17 16:02:00 2024 -0400 removes selector compactions (#4397) Co-authored-by: Daniel Roberts <ddani...@gmail.com> --- .../core/client/admin/compaction/CompactionSelector.java | 3 +-- core/src/main/java/org/apache/accumulo/core/conf/Property.java | 9 +-------- .../apache/accumulo/core/spi/compaction/CompactionKind.java | 6 ------ .../core/spi/compaction/RatioBasedCompactionPlanner.java | 10 ++++------ .../accumulo/core/tabletserver/thrift/TCompactionKind.java | 3 --- core/src/main/thrift/tabletserver.thrift | 6 +++--- .../core/util/compaction/CompactionPrioritizerTest.java | 4 ++-- .../src/main/java/org/apache/accumulo/compactor/ExtCEnv.java | 1 - .../manager/compaction/coordinator/CompactionCoordinator.java | 2 -- .../compaction/coordinator/commit/CommitCompaction.java | 4 ++-- 10 files changed, 13 insertions(+), 35 deletions(-) diff --git a/core/src/main/java/org/apache/accumulo/core/client/admin/compaction/CompactionSelector.java b/core/src/main/java/org/apache/accumulo/core/client/admin/compaction/CompactionSelector.java index 281372d43d..311ffc730e 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/admin/compaction/CompactionSelector.java +++ b/core/src/main/java/org/apache/accumulo/core/client/admin/compaction/CompactionSelector.java @@ -35,8 +35,7 @@ import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; /** - * This class selects which files a user compaction will compact. It can also be configured per - * table to periodically select files to compact. + * This class selects which files a user compaction will compact. * * @since 2.1.0 */ diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java index e33eed2748..b05e0aba4e 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java @@ -855,12 +855,6 @@ public enum Property { + "specified time. If a system compaction cancels a hold and runs, then the user compaction" + " can reselect and hold files after the system compaction runs.", "2.1.0"), - TABLE_COMPACTION_SELECTOR("table.compaction.selector", "", PropertyType.CLASSNAME, - "A configurable selector for a table that can periodically select file for mandatory " - + "compaction, even if the files do not meet the compaction ratio.", - "2.1.0"), - TABLE_COMPACTION_SELECTOR_OPTS("table.compaction.selector.opts.", null, PropertyType.PREFIX, - "Options for the table compaction dispatcher.", "2.1.0"), TABLE_COMPACTION_CONFIGURER("table.compaction.configurer", "", PropertyType.CLASSNAME, "A plugin that can dynamically configure compaction output files based on input files.", "2.1.0"), @@ -1414,8 +1408,7 @@ public enum Property { || key.startsWith(TABLE_SUMMARIZER_PREFIX.getKey()) || key.startsWith(TABLE_SCAN_DISPATCHER_OPTS.getKey()) || key.startsWith(TABLE_COMPACTION_DISPATCHER_OPTS.getKey()) - || key.startsWith(TABLE_COMPACTION_CONFIGURER_OPTS.getKey()) - || key.startsWith(TABLE_COMPACTION_SELECTOR_OPTS.getKey())) + || key.startsWith(TABLE_COMPACTION_CONFIGURER_OPTS.getKey())) || key.startsWith(TABLE_CRYPTO_PREFIX.getKey())); } diff --git a/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java b/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java index 97e64216fc..7667dcf577 100644 --- a/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java +++ b/core/src/main/java/org/apache/accumulo/core/spi/compaction/CompactionKind.java @@ -18,8 +18,6 @@ */ package org.apache.accumulo.core.spi.compaction; -import org.apache.accumulo.core.client.admin.compaction.CompactionSelector; - /** * @since 2.1.0 * @see org.apache.accumulo.core.spi.compaction @@ -29,10 +27,6 @@ public enum CompactionKind { * A system initiated routine compaction. */ SYSTEM, - /** - * Set of files selected by a {@link CompactionSelector} configured for a table. - */ - SELECTOR, /** * A user initiated a one time compaction using an Accumulo client. */ diff --git a/core/src/main/java/org/apache/accumulo/core/spi/compaction/RatioBasedCompactionPlanner.java b/core/src/main/java/org/apache/accumulo/core/spi/compaction/RatioBasedCompactionPlanner.java index aa5cb8d137..ec3b91d779 100644 --- a/core/src/main/java/org/apache/accumulo/core/spi/compaction/RatioBasedCompactionPlanner.java +++ b/core/src/main/java/org/apache/accumulo/core/spi/compaction/RatioBasedCompactionPlanner.java @@ -306,11 +306,10 @@ public class RatioBasedCompactionPlanner implements CompactionPlanner { } } - if (compactionJobs.size() == 1 - && (params.getKind() == CompactionKind.USER || params.getKind() == CompactionKind.SELECTOR) + if (compactionJobs.size() == 1 && params.getKind() == CompactionKind.USER && compactionJobs.get(0).size() < params.getCandidates().size() && compactionJobs.get(0).size() <= maxFilesToCompact) { - // USER and SELECTOR compactions must eventually compact all files. When a subset of files + // USER compactions must eventually compact all files. When a subset of files // that meets the compaction ratio is selected, look ahead and see if the next compaction // would also meet the compaction ratio. If not then compact everything to avoid doing // more than logarithmic work across multiple comapctions. @@ -330,9 +329,8 @@ public class RatioBasedCompactionPlanner implements CompactionPlanner { } if (compactionJobs.isEmpty()) { - if ((params.getKind() == CompactionKind.USER || params.getKind() == CompactionKind.SELECTOR) - && params.getRunningCompactions().stream() - .noneMatch(job -> job.getKind() == params.getKind())) { + if (params.getKind() == CompactionKind.USER && params.getRunningCompactions().stream() + .noneMatch(job -> job.getKind() == params.getKind())) { // These kinds of compaction require files to compact even if none of the files meet the // compaction ratio. No files were found using the compaction ratio and no compactions are // running, so force a compaction. diff --git a/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionKind.java b/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionKind.java index 8600b9336d..cdae992ed0 100644 --- a/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionKind.java +++ b/core/src/main/thrift-gen-java/org/apache/accumulo/core/tabletserver/thrift/TCompactionKind.java @@ -26,7 +26,6 @@ package org.apache.accumulo.core.tabletserver.thrift; public enum TCompactionKind implements org.apache.thrift.TEnum { - SELECTOR(0), SYSTEM(1), USER(2); @@ -51,8 +50,6 @@ public enum TCompactionKind implements org.apache.thrift.TEnum { @org.apache.thrift.annotation.Nullable public static TCompactionKind findByValue(int value) { switch (value) { - case 0: - return SELECTOR; case 1: return SYSTEM; case 2: diff --git a/core/src/main/thrift/tabletserver.thrift b/core/src/main/thrift/tabletserver.thrift index 7db5f5c9ed..e10bc182a4 100644 --- a/core/src/main/thrift/tabletserver.thrift +++ b/core/src/main/thrift/tabletserver.thrift @@ -116,9 +116,9 @@ struct TExternalCompactionJob { } enum TCompactionKind { - SELECTOR - SYSTEM - USER + // SELECTOR was removed and used to be zero + SYSTEM = 1 + USER = 2 } struct TCompactionGroupSummary { diff --git a/core/src/test/java/org/apache/accumulo/core/util/compaction/CompactionPrioritizerTest.java b/core/src/test/java/org/apache/accumulo/core/util/compaction/CompactionPrioritizerTest.java index e1c1b9983c..0811edf748 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/compaction/CompactionPrioritizerTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/compaction/CompactionPrioritizerTest.java @@ -183,8 +183,8 @@ public class CompactionPrioritizerTest { var j3 = createJob(CompactionKind.USER, "t-011", 11, 20); var j4 = createJob(CompactionKind.SYSTEM, "t-012", 11, 30); var j5 = createJob(CompactionKind.SYSTEM, "t-013", 5, 10); - var j8 = createJob(CompactionKind.SELECTOR, "t-014", 5, 21); - var j9 = createJob(CompactionKind.SELECTOR, "t-015", 7, 20); + var j8 = createJob(CompactionKind.SYSTEM, "t-014", 5, 21); + var j9 = createJob(CompactionKind.SYSTEM, "t-015", 7, 20); var expected = List.of(j2, j3, j1, j4, j9, j8, j5); diff --git a/server/compactor/src/main/java/org/apache/accumulo/compactor/ExtCEnv.java b/server/compactor/src/main/java/org/apache/accumulo/compactor/ExtCEnv.java index ea1c5245e1..490e5908ba 100644 --- a/server/compactor/src/main/java/org/apache/accumulo/compactor/ExtCEnv.java +++ b/server/compactor/src/main/java/org/apache/accumulo/compactor/ExtCEnv.java @@ -90,7 +90,6 @@ public class ExtCEnv implements CompactionEnv { switch (job.getKind()) { case USER: return TCompactionReason.USER; - case SELECTOR: case SYSTEM: return TCompactionReason.SYSTEM; default: diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java b/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java index 5eb0ab7414..87f8fc01d8 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java @@ -461,7 +461,6 @@ public class CompactionCoordinator } break; case USER: - case SELECTOR: if (tablet.getSelectedFiles() == null || !tablet.getSelectedFiles().getFiles().containsAll(jobFiles)) { return false; @@ -509,7 +508,6 @@ public class CompactionCoordinator propDels = !compactingAll; } break; - case SELECTOR: case USER: { boolean compactingAll = tablet.getSelectedFiles().initiallySelectedAll() && tablet.getSelectedFiles().getFiles().equals(jobFiles); diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/commit/CommitCompaction.java b/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/commit/CommitCompaction.java index 7add060466..6b3db6b136 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/commit/CommitCompaction.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/compaction/coordinator/commit/CommitCompaction.java @@ -120,7 +120,7 @@ public class CommitCompaction extends ManagerRepo { var tabletMutator = tabletsMutator.mutateTablet(getExtent()).requireAbsentOperation() .requireCompaction(ecid).requireSame(tablet, FILES, LOCATION); - if (ecm.getKind() == CompactionKind.USER || ecm.getKind() == CompactionKind.SELECTOR) { + if (ecm.getKind() == CompactionKind.USER) { tabletMutator.requireSame(tablet, SELECTED, COMPACTED); } @@ -242,7 +242,7 @@ public class CommitCompaction extends ManagerRepo { return false; } - if (ecm.getKind() == CompactionKind.USER || ecm.getKind() == CompactionKind.SELECTOR) { + if (ecm.getKind() == CompactionKind.USER) { if (tabletMetadata.getSelectedFiles() == null) { // when the compaction is canceled, selected files are deleted LOG.debug(