This is an automated email from the ASF dual-hosted git repository. dlmarion pushed a commit to branch 2.1 in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push: new 9ac9ddd95c Validate group names passed in server arguments (#5222) 9ac9ddd95c is described below commit 9ac9ddd95cb7c616e7f6ad38e41e952341730253 Author: Dave Marion <dlmar...@apache.org> AuthorDate: Fri Jan 3 14:14:16 2025 -0500 Validate group names passed in server arguments (#5222) Closes #5042 --- .../src/main/java/org/apache/accumulo/compactor/Compactor.java | 3 +++ .../src/test/java/org/apache/accumulo/compactor/CompactorTest.java | 2 +- .../tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java b/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java index b7426ce31b..83ff5de7ee 100644 --- a/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java +++ b/server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java @@ -30,6 +30,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.TreeMap; import java.util.UUID; import java.util.concurrent.CountDownLatch; @@ -60,6 +61,7 @@ import org.apache.accumulo.core.compaction.thrift.UnknownCompactionIdException; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.ConfigurationCopy; import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.conf.cluster.ClusterConfigParser; import org.apache.accumulo.core.data.NamespaceId; import org.apache.accumulo.core.data.TableId; import org.apache.accumulo.core.dataImpl.KeyExtent; @@ -175,6 +177,7 @@ public class Compactor extends AbstractServer implements MetricsProducer, Compac protected Compactor(CompactorServerOpts opts, String[] args) { super("compactor", opts, args); queueName = opts.getQueueName(); + ClusterConfigParser.validateGroupNames(Set.of(queueName)); } private long getTotalEntriesRead() { diff --git a/server/compactor/src/test/java/org/apache/accumulo/compactor/CompactorTest.java b/server/compactor/src/test/java/org/apache/accumulo/compactor/CompactorTest.java index 1eb76e1016..e6d4a32b4e 100644 --- a/server/compactor/src/test/java/org/apache/accumulo/compactor/CompactorTest.java +++ b/server/compactor/src/test/java/org/apache/accumulo/compactor/CompactorTest.java @@ -507,7 +507,7 @@ public class CompactorTest { Compactor.CompactorServerOpts compactorServerOpts = PowerMock.createNiceMock(Compactor.CompactorServerOpts.class); - expect(compactorServerOpts.getQueueName()).andReturn(null); + expect(compactorServerOpts.getQueueName()).andReturn("default"); PowerMock.replayAll(); diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java index 90a4fc0854..b3301f426c 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java @@ -53,6 +53,7 @@ import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.conf.cluster.ClusterConfigParser; import org.apache.accumulo.core.dataImpl.KeyExtent; import org.apache.accumulo.core.dataImpl.thrift.InitialMultiScan; import org.apache.accumulo.core.dataImpl.thrift.InitialScan; @@ -280,6 +281,7 @@ public class ScanServer extends AbstractServer delegate = newThriftScanClientHandler(new WriteTracker()); this.groupName = Objects.requireNonNull(opts.getGroupName()); + ClusterConfigParser.validateGroupNames(Set.of(groupName)); ThreadPools.watchCriticalScheduledTask(getContext().getScheduledExecutor() .scheduleWithFixedDelay(() -> cleanUpReservedFiles(scanServerReservationExpiration),