Skip to content

Commit

Permalink
Fix KeywordStartIT broken by #5073
Browse files Browse the repository at this point in the history
* Remove main method and move implementation to the execute method in
  the new CheckAccumuloProperties command
* Add the new KeywordExecutable class to the IT
  • Loading branch information
ctubbsii committed Dec 17, 2024
1 parent 79d972f commit 7b746cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@
@AutoService(KeywordExecutable.class)
public class CheckAccumuloProperties implements KeywordExecutable {

@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "intentional user-provided path")
public static void main(String[] args) throws IOException {
Preconditions.checkArgument(args.length == 1,
"Expected 1 argument (the properties file path), got " + args.length);
var hadoopConfig = new Configuration();
var siteConfig = SiteConfiguration.fromFile(new File(args[0])).build();

VolumeManagerImpl.get(siteConfig, hadoopConfig);
new ServerDirs(siteConfig, hadoopConfig);
}

@Override
public String keyword() {
return "check-accumulo-properties";
Expand All @@ -59,8 +48,16 @@ public String description() {
+ (new CheckServerConfig().keyword());
}

@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "intentional user-provided path")
@Override
public void execute(String[] args) throws Exception {
main(args);
public void execute(String[] args) throws IOException {
Preconditions.checkArgument(args.length == 1,
"Expected 1 argument (the properties file path), got " + args.length);
var hadoopConfig = new Configuration();
var siteConfig = SiteConfiguration.fromFile(new File(args[0])).build();

VolumeManagerImpl.get(siteConfig, hadoopConfig);
new ServerDirs(siteConfig, hadoopConfig);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.apache.accumulo.miniclusterImpl.MiniClusterExecutable;
import org.apache.accumulo.monitor.Monitor;
import org.apache.accumulo.monitor.MonitorExecutable;
import org.apache.accumulo.server.conf.CheckAccumuloProperties;
import org.apache.accumulo.server.conf.CheckCompactionConfig;
import org.apache.accumulo.server.conf.CheckServerConfig;
import org.apache.accumulo.server.conf.util.ConfigPropertyUpgrader;
Expand Down Expand Up @@ -131,6 +132,7 @@ public void testExpectedClasses() {
expectSet.put("admin", Admin.class);
expectSet.put("check-compaction-config", CheckCompactionConfig.class);
expectSet.put("check-server-config", CheckServerConfig.class);
expectSet.put("check-accumulo-properties", CheckAccumuloProperties.class);
expectSet.put("compaction-coordinator", CoordinatorExecutable.class);
expectSet.put("compactor", CompactorExecutable.class);
expectSet.put("config-upgrade", ConfigPropertyUpgrader.class);
Expand Down

0 comments on commit 7b746cd

Please sign in to comment.