@InterfaceAudience.Private public abstract class AbstractHBaseTool extends Object
Modifier and Type | Field and Description |
---|---|
protected String[] |
cmdLineArgs |
protected Configuration |
conf |
protected static int |
EXIT_FAILURE |
protected static int |
EXIT_SUCCESS |
Constructor and Description |
---|
AbstractHBaseTool() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addOptions()
Override this to add command-line options using
addOptWithArg(java.lang.String, java.lang.String)
and similar methods. |
protected void |
addOptNoArg(String opt,
String description) |
protected void |
addOptNoArg(String shortOpt,
String longOpt,
String description) |
protected void |
addOptWithArg(String opt,
String description) |
protected void |
addOptWithArg(String shortOpt,
String longOpt,
String description) |
protected void |
addRequiredOptWithArg(String opt,
String description) |
protected void |
addRequiredOptWithArg(String shortOpt,
String longOpt,
String description) |
protected void |
doStaticMain(String[] args)
Call this from the concrete tool class's main function.
|
protected abstract int |
doWork()
The "main function" of the tool
|
Configuration |
getConf() |
protected CommandLine |
parseArgs(String[] args) |
static int |
parseInt(String s,
int minValue,
int maxValue) |
static long |
parseLong(String s,
long minValue,
long maxValue)
Parse a number and enforce a range.
|
protected void |
printUsage() |
protected void |
printUsage(String usageStr,
String usageHeader,
String usageFooter) |
protected abstract void |
processOptions(CommandLine cmd)
This method is called to process the options after they have been parsed.
|
int |
run(String[] args) |
void |
setConf(Configuration conf) |
protected static final int EXIT_SUCCESS
protected static final int EXIT_FAILURE
protected Configuration conf
protected String[] cmdLineArgs
protected abstract void addOptions()
addOptWithArg(java.lang.String, java.lang.String)
and similar methods.protected abstract void processOptions(CommandLine cmd)
protected abstract int doWork() throws Exception
Exception
public Configuration getConf()
public void setConf(Configuration conf)
public final int run(String[] args) throws IOException
IOException
protected CommandLine parseArgs(String[] args) throws ParseException
ParseException
protected void printUsage()
protected void addRequiredOptWithArg(String shortOpt, String longOpt, String description)
public static long parseLong(String s, long minValue, long maxValue)
public static int parseInt(String s, int minValue, int maxValue)
protected void doStaticMain(String[] args)