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