This is an automated email from the ASF dual-hosted git repository.
ctubbsii 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 7b746cd08f Fix KeywordStartIT broken by #5073
7b746cd08f is described below
commit 7b746cd08fc18ea3e75ea5f5180c1a6661367db5
Author: Christopher Tubbs <[email protected]>
AuthorDate: Tue Dec 17 12:53:22 2024 -0500
Fix KeywordStartIT broken by #5073
* Remove main method and move implementation to the execute method in
the new CheckAccumuloProperties command
* Add the new KeywordExecutable class to the IT
---
.../server/conf/CheckAccumuloProperties.java | 23 ++++++++++------------
.../apache/accumulo/test/start/KeywordStartIT.java | 2 ++
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git
a/server/base/src/main/java/org/apache/accumulo/server/conf/CheckAccumuloProperties.java
b/server/base/src/main/java/org/apache/accumulo/server/conf/CheckAccumuloProperties.java
index e7c7394fec..08684a5208 100644
---
a/server/base/src/main/java/org/apache/accumulo/server/conf/CheckAccumuloProperties.java
+++
b/server/base/src/main/java/org/apache/accumulo/server/conf/CheckAccumuloProperties.java
@@ -35,17 +35,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@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";
@@ -59,8 +48,16 @@ public class CheckAccumuloProperties implements
KeywordExecutable {
+ (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);
}
+
}
diff --git
a/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
b/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
index 97b75467e5..5579510723 100644
--- a/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/start/KeywordStartIT.java
@@ -53,6 +53,7 @@ import org.apache.accumulo.minicluster.MiniAccumuloRunner;
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;
@@ -131,6 +132,7 @@ public class KeywordStartIT {
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);