HBASE-12616 We lost the linked list commands in recent usage refactoring

This commit is contained in:
stack 2014-12-02 14:15:04 -08:00
parent e424d4254e
commit 23382fe625
2 changed files with 31 additions and 33 deletions

View File

@ -1123,25 +1123,21 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase {
private void usage() {
System.err.println("Usage: " + this.getClass().getSimpleName() + " COMMAND [COMMAND options]");
System.err.println(" where COMMAND is one of:");
System.err.println("");
System.err.println(" Generator A map only job that generates data.");
System.err.println(" Verify A map reduce job that looks for holes");
System.err.println(" Look at the counts after running");
System.err.println(" REFERENCED and UNREFERENCED are ok");
System.err.println(" any UNDEFINED counts are bad. Do not");
System.err.println(" run at the same time as the Generator.");
System.err.println(" Walker A standalong program that starts ");
System.err.println(" following a linked list and emits");
System.err.println(" timing info.");
System.err.println(" Print A standalone program that prints nodes");
System.err.println(" in the linked list.");
System.err.println(" Delete A standalone program that deletes a·");
System.err.println(" single node.");
System.err.println(" Loop A program to Loop through Generator and");
System.err.println(" Verify steps");
System.err.println(" Clean A program to clean all left over detritus.");
System.err.println("\t ");
printCommands();
}
private void printCommands() {
System.err.println("Commands:");
System.err.println(" Generator Map only job that generates data.");
System.err.println(" Verify A map reduce job that looks for holes. Look at the counts ");
System.err.println(" after running. See REFERENCED and UNREFERENCED are ok. Any ");
System.err.println(" UNDEFINED counts are bad. Do not run with the Generator.");
System.err.println(" Walker " +
"Standalong program that starts following a linked list & emits timing info.");
System.err.println(" Print Standalone program that prints nodes in the linked list.");
System.err.println(" Delete Standalone program that deletes a·single node.");
System.err.println(" Loop Program to Loop through Generator and Verify steps");
System.err.println(" Clean Program to clean all left over detritus.");
System.err.flush();
}
@ -1151,7 +1147,9 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase {
String[] args = cmd.getArgs();
//get the class, run with the conf
if (args.length < 1) {
printUsage();
printUsage(this.getClass().getSimpleName() +
" <general options> COMMAND [<COMMAND options>]", "General options:", "");
printCommands();
throw new RuntimeException("Incorrect Number of args.");
}
toRun = args[0];
@ -1164,19 +1162,19 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase {
Tool tool = null;
if (toRun.equals("Generator")) {
tool = new Generator();
} else if (toRun.equals("Verify")) {
} else if (toRun.equalsIgnoreCase("Verify")) {
tool = new Verify();
} else if (toRun.equals("Loop")) {
} else if (toRun.equalsIgnoreCase("Loop")) {
Loop loop = new Loop();
loop.it = this;
tool = loop;
} else if (toRun.equals("Walker")) {
} else if (toRun.equalsIgnoreCase("Walker")) {
tool = new Walker();
} else if (toRun.equals("Print")) {
} else if (toRun.equalsIgnoreCase("Print")) {
tool = new Print();
} else if (toRun.equals("Delete")) {
} else if (toRun.equalsIgnoreCase("Delete")) {
tool = new Delete();
} else if (toRun.equals("Clean")) {
} else if (toRun.equalsIgnoreCase("Clean")) {
tool = new Clean();
} else {
usage();

View File

@ -136,14 +136,14 @@ public abstract class AbstractHBaseTool implements Tool {
}
protected void printUsage() {
HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.setWidth(80);
String usageHeader = "Options:";
String usageFooter = "";
String usageStr = "bin/hbase " + getClass().getName() + " <options>";
printUsage("bin/hbase " + getClass().getName() + " <options>", "Options:", "");
}
helpFormatter.printHelp(usageStr, usageHeader, options,
usageFooter);
protected void printUsage(final String usageStr, final String usageHeader,
final String usageFooter) {
HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.setWidth(120);
helpFormatter.printHelp(usageStr, usageHeader, options, usageFooter);
}
protected void addRequiredOptWithArg(String opt, String description) {