Skip to content

Commit 9ac9ddd

Browse files
authored
Validate group names passed in server arguments (apache#5222)
Closes apache#5042
1 parent 44b97f3 commit 9ac9ddd

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.util.Collection;
3131
import java.util.List;
3232
import java.util.Map;
33+
import java.util.Set;
3334
import java.util.TreeMap;
3435
import java.util.UUID;
3536
import java.util.concurrent.CountDownLatch;
@@ -60,6 +61,7 @@
6061
import org.apache.accumulo.core.conf.AccumuloConfiguration;
6162
import org.apache.accumulo.core.conf.ConfigurationCopy;
6263
import org.apache.accumulo.core.conf.Property;
64+
import org.apache.accumulo.core.conf.cluster.ClusterConfigParser;
6365
import org.apache.accumulo.core.data.NamespaceId;
6466
import org.apache.accumulo.core.data.TableId;
6567
import org.apache.accumulo.core.dataImpl.KeyExtent;
@@ -175,6 +177,7 @@ public String getQueueName() {
175177
protected Compactor(CompactorServerOpts opts, String[] args) {
176178
super("compactor", opts, args);
177179
queueName = opts.getQueueName();
180+
ClusterConfigParser.validateGroupNames(Set.of(queueName));
178181
}
179182

180183
private long getTotalEntriesRead() {

server/compactor/src/test/java/org/apache/accumulo/compactor/CompactorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public void testCompactionWaitProperty() {
507507

508508
Compactor.CompactorServerOpts compactorServerOpts =
509509
PowerMock.createNiceMock(Compactor.CompactorServerOpts.class);
510-
expect(compactorServerOpts.getQueueName()).andReturn(null);
510+
expect(compactorServerOpts.getQueueName()).andReturn("default");
511511

512512
PowerMock.replayAll();
513513

server/tserver/src/main/java/org/apache/accumulo/tserver/ScanServer.java

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException;
5454
import org.apache.accumulo.core.conf.AccumuloConfiguration;
5555
import org.apache.accumulo.core.conf.Property;
56+
import org.apache.accumulo.core.conf.cluster.ClusterConfigParser;
5657
import org.apache.accumulo.core.dataImpl.KeyExtent;
5758
import org.apache.accumulo.core.dataImpl.thrift.InitialMultiScan;
5859
import org.apache.accumulo.core.dataImpl.thrift.InitialScan;
@@ -280,6 +281,7 @@ public ScanServer(ScanServerOpts opts, String[] args) {
280281
delegate = newThriftScanClientHandler(new WriteTracker());
281282

282283
this.groupName = Objects.requireNonNull(opts.getGroupName());
284+
ClusterConfigParser.validateGroupNames(Set.of(groupName));
283285

284286
ThreadPools.watchCriticalScheduledTask(getContext().getScheduledExecutor()
285287
.scheduleWithFixedDelay(() -> cleanUpReservedFiles(scanServerReservationExpiration),

0 commit comments

Comments
 (0)