jmark99 commented on a change in pull request #2106:
URL: https://github.com/apache/accumulo/pull/2106#discussion_r631927019
##########
File path:
server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java
##########
@@ -73,19 +77,37 @@
* @param args
* - first argument is the file to print
*/
- public static void main(String[] args) throws IOException {
+ public static void main(String[] args) throws Exception {
+ new LogReader().execute(args);
+ }
+
+ @Override
+ public String keyword() {
+ return "wal-info";
+ }
+
+ @Override
+ public String description() {
+ return "Prints WAL Info";
+ }
+
+ @SuppressFBWarnings(value = "DM_EXIT",
+ justification = "System.exit is fine here because it's a utility class
executed by a main()")
+ @Override
+ public void execute(String[] args) throws Exception {
Opts opts = new Opts();
- opts.parseArgs(LogReader.class.getName(), args);
+ opts.parseArgs("accumulo wal-info", args);
+ if (opts.files.isEmpty()) {
+ System.err.println("No WAL files were given");
+ System.exit(1);
+ }
Review comment:
There is a -h/--help and -? option available for the command. I followed
the convention used with accumulo rfile-info. Initially I printed the given
message and called the JCommander usage command. I wasn't particularly happy
with what it printed out initially:
<pre>
Usage: <main class> [options] <logfile> { **<logfile** ...}
</pre>
I didn't find a way to have it replace '<main class>' with 'accumulo
wal-info. The help options properly display 'accumulo wal-info ...' in the
usage statement as desired. I'm okay putting the JCommander.usage back in but I
wasn't sure if the <main class> verbiage would be confusing to users. Thoughts?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]