Skip to content

Commit

Permalink
Validate group names passed in server arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
dlmarion committed Jan 3, 2025
1 parent 44b97f3 commit a7514bf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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;
Expand Down Expand Up @@ -60,6 +61,7 @@
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;
Expand Down Expand Up @@ -175,6 +177,7 @@ public String getQueueName() {
protected Compactor(CompactorServerOpts opts, String[] args) {
super("compactor", opts, args);
queueName = opts.getQueueName();
ClusterConfigParser.validateGroupNames(Set.of(queueName));
}

private long getTotalEntriesRead() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ public void testCompactionWaitProperty() {

Compactor.CompactorServerOpts compactorServerOpts =
PowerMock.createNiceMock(Compactor.CompactorServerOpts.class);
expect(compactorServerOpts.getQueueName()).andReturn(null);
expect(compactorServerOpts.getQueueName()).andReturn("default");

PowerMock.replayAll();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
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;
Expand Down Expand Up @@ -280,6 +281,7 @@ public ScanServer(ScanServerOpts opts, String[] args) {
delegate = newThriftScanClientHandler(new WriteTracker());

this.groupName = Objects.requireNonNull(opts.getGroupName());
ClusterConfigParser.validateGroupNames(Set.of(groupName));

ThreadPools.watchCriticalScheduledTask(getContext().getScheduledExecutor()
.scheduleWithFixedDelay(() -> cleanUpReservedFiles(scanServerReservationExpiration),
Expand Down

0 comments on commit a7514bf

Please sign in to comment.