Package org.apache.hadoop.tools
Class CommandShell
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.tools.CommandShell
- All Implemented Interfaces:
Configurable,Tool
- Direct Known Subclasses:
CredentialShell,DtUtilShell,KeyShell
This program is a CLI utility base class utilizing hadoop Tool class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classBase class for any subcommands of this shell command. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringReturn usage string for the command including any summary of subcommands.getErr()getOut()protected abstract intParse the command line arguments and initialize subcommand instance.protected voidprotected final voidintExecute the command with the given arguments.voidvoidvoidMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Constructor Details
-
CommandShell
public CommandShell()
-
-
Method Details
-
getCommandUsage
Return usage string for the command including any summary of subcommands.- Returns:
- command usage.
-
setSubCommand
-
setOut
-
getOut
-
setErr
-
getErr
-
run
Description copied from interface:ToolExecute the command with the given arguments. -
init
Parse the command line arguments and initialize subcommand instance.- Parameters:
args- arguments.- Returns:
- 0 if the argument(s) were recognized, 1 otherwise
- Throws:
Exception- init exception.
-
printShellUsage
protected final void printShellUsage() -
printException
-