@NotThreadSafe public abstract class AbstractShell extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
protected com.google.common.io.Closer |
mCloser |
protected InstancedConfiguration |
mConfiguration |
Constructor and Description |
---|
AbstractShell(Map<String,String[]> commandAlias,
Set<String> unstableAlias,
InstancedConfiguration conf)
Creates a new instance of
AbstractShell . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Collection<Command> |
getCommands() |
protected abstract String |
getShellName() |
protected abstract Map<String,Command> |
loadCommands()
Map structure: Command name =>
Command instance. |
protected void |
printUsage()
Prints usage for all commands.
|
int |
run(String... argv)
Handles the specified shell command request, displaying usage if the command format is invalid.
|
protected InstancedConfiguration mConfiguration
protected com.google.common.io.Closer mCloser
public AbstractShell(Map<String,String[]> commandAlias, Set<String> unstableAlias, InstancedConfiguration conf)
AbstractShell
.commandAlias
- replacements for commandsunstableAlias
- set of unstable aliases which may be removed in the futureconf
- Alluxio configurationpublic int run(String... argv)
argv
- [] Array of arguments given by the user's input from the terminalpublic Collection<Command> getCommands()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected abstract String getShellName()
protected abstract Map<String,Command> loadCommands()
Command
instance.protected void printUsage()
Copyright © 2023. All Rights Reserved.