Package org.apache.hadoop.fs
Class FsShell
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.FsShell
- All Implemented Interfaces:
Configurable,Tool
Provide command line access to a FileSystem.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classDisplays short usage of commands sans the long descriptionprotected classDisplay help for commands with their short usage and long description. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFsShell()Default ctor with no configuration.FsShell(Configuration conf) Construct a FsShell with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Performs any necessary cleanupReturns the Trash object associated with this shell.getCurrentTrashDir(Path path) Returns the current trash location for the path specifiedprotected FileSystemgetFS()protected FsShell.HelpgetHelp()protected TrashgetTrash()protected Stringprotected voidinit()static voidmain() has some simple utility methodsprotected static FsShellprotected voidregisterCommands(CommandFactory factory) intrunMethods 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
-
Field Details
-
commandFactory
-
-
Constructor Details
-
FsShell
public FsShell()Default ctor with no configuration. Be sure to invokeConfigured.setConf(Configuration)with a valid configuration prior to running commands. -
FsShell
Construct a FsShell with the given configuration. Commands can be executed viarun(String[])- Parameters:
conf- the hadoop configuration
-
-
Method Details
-
getFS
- Throws:
IOException
-
getTrash
- Throws:
IOException
-
getHelp
- Throws:
IOException
-
init
protected void init() -
registerCommands
-
getCurrentTrashDir
Returns the Trash object associated with this shell.- Returns:
- Path to the trash
- Throws:
IOException- upon error
-
getCurrentTrashDir
Returns the current trash location for the path specified- Parameters:
path- to be deleted- Returns:
- path to the trash
- Throws:
IOException- raised on errors performing I/O.
-
getUsagePrefix
-
run
run -
close
Performs any necessary cleanup- Throws:
IOException- upon error
-
main
main() has some simple utility methods- Parameters:
argv- the command and its arguments- Throws:
Exception- upon error
-
newShellInstance
-