|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.util.AbstractHBaseTool
@InterfaceAudience.Private public abstract class AbstractHBaseTool
Common base class used for HBase command-line tools. Simplifies workflow and command-line argument parsing.
| Field Summary | |
|---|---|
protected org.apache.hadoop.conf.Configuration |
conf
|
| Constructor Summary | |
|---|---|
AbstractHBaseTool()
|
|
| Method Summary | |
|---|---|
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 |
doStaticMain(String[] args)
Call this from the concrete tool class's main function. |
protected abstract int |
doWork()
The "main function" of the tool |
org.apache.hadoop.conf.Configuration |
getConf()
|
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 abstract void |
processOptions(org.apache.commons.cli.CommandLine cmd)
This method is called to process the options after they have been parsed. |
int |
run(String[] args)
|
void |
setConf(org.apache.hadoop.conf.Configuration conf)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.hadoop.conf.Configuration conf
| Constructor Detail |
|---|
public AbstractHBaseTool()
| Method Detail |
|---|
protected abstract void addOptions()
addOptWithArg(java.lang.String, java.lang.String)
and similar methods.
protected abstract void processOptions(org.apache.commons.cli.CommandLine cmd)
protected abstract int doWork()
throws Exception
Exceptionpublic org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurablepublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurable
public final int run(String[] args)
throws Exception
run in interface org.apache.hadoop.util.ToolException
protected void addRequiredOptWithArg(String opt,
String description)
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)
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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||