keith-turner commented on code in PR #4807:
URL: https://github.com/apache/accumulo/pull/4807#discussion_r1736449843
##########
server/base/src/main/java/org/apache/accumulo/server/util/Admin.java:
##########
@@ -114,6 +127,93 @@ static class PingCommand {
List<String> args = new ArrayList<>();
}
+ @Parameters(commandNames = "check",
+ commandDescription = "Performs checks for problems in Accumulo.")
+ public static class CheckCommand {
+ @Parameter(names = "list",
+ description = "Lists the different checks that can be run, the
description of each check, and the other check(s) each check depends on.")
+ boolean list;
+
+ @Parameter(names = "run",
+ description = "Runs the provided check(s) (explicit list or regex
pattern specified following '-p'), beginning with their dependencies, or all
checks if none are provided.")
+ boolean run;
+
+ @Parameter(names = {"--name_pattern", "-p"},
+ description = "Runs all checks that match the provided regex pattern.")
+ boolean useRegex;
Review Comment:
Would it be possible to make the following change? Seems that currently
when pattern is specified it looks for the pattern in the `checks` parameter.
```suggestion
@Parameter(names = {"--name_pattern", "-p"},
description = "Runs all checks that match the provided regex
pattern.")
String pattern;
```
##########
test/src/main/java/org/apache/accumulo/test/AdminCheckIT.java:
##########
@@ -0,0 +1,360 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.accumulo.test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.UncheckedIOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.function.Supplier;
+
+import org.apache.accumulo.server.cli.ServerUtilOpts;
+import org.apache.accumulo.server.util.Admin;
+import org.apache.accumulo.server.util.checkCommand.CheckRunner;
+import org.apache.accumulo.test.functional.ConfigurableMacBase;
+import org.easymock.EasyMock;
+import org.easymock.IAnswer;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+import com.beust.jcommander.JCommander;
+
+public class AdminCheckIT extends ConfigurableMacBase {
Review Comment:
I see a test w/ the pattern option that matches nothing, but not one that
matches a subset. If possible it would be nice to add one that matches a
subset.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]