public abstract class CommandShell extends Configured implements Tool
Modifier and Type | Class and Description |
---|---|
protected class |
CommandShell.SubCommand
Base class for any subcommands of this shell command.
|
Constructor and Description |
---|
CommandShell() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getCommandUsage()
Return usage string for the command including any summary of subcommands.
|
PrintStream |
getErr() |
PrintStream |
getOut() |
protected abstract int |
init(String[] args)
Parse the command line arguments and initialize subcommand instance.
|
protected void |
printException(Exception ex) |
protected void |
printShellUsage() |
int |
run(String[] args)
Execute the command with the given arguments.
|
void |
setErr(PrintStream p) |
void |
setOut(PrintStream p) |
void |
setSubCommand(CommandShell.SubCommand cmd) |
getConf, setConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConf, setConf
public abstract String getCommandUsage()
public void setSubCommand(CommandShell.SubCommand cmd)
public void setOut(PrintStream p)
public PrintStream getOut()
public void setErr(PrintStream p)
public PrintStream getErr()
public int run(String[] args) throws Exception
Tool
protected abstract int init(String[] args) throws Exception
args
- Exception
protected final void printShellUsage()
protected void printException(Exception ex)
Copyright © 2008–2020 Apache Software Foundation. All rights reserved.