Package org.apache.hadoop.fs.shell
Class FsCommand
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.shell.Command
org.apache.hadoop.fs.shell.FsCommand
- All Implemented Interfaces:
Configurable
- Direct Known Subclasses:
Concat,CopyCommandWithMultiThread,Count,Find,FsShell.Help,FsShell.Usage,FsShellPermissions,TouchCommands,Truncate
Base class for all "hadoop fs" commands.
-
Field Summary
Fields inherited from class org.apache.hadoop.fs.shell.Command
args, COMMAND_DESCRIPTION_FIELD, COMMAND_NAME_FIELD, COMMAND_USAGE_FIELD, err, exceptions, exitCode, name, numErrors, out, recursive -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprocessRawArguments(LinkedList<String> args) Allows commands that don't use paths to handle the raw arguments.static voidregisterCommands(CommandFactory factory) Register the command classes used by the fs subcommandprotected voidExecute the command on the input pathintrunAll()Deprecated.Methods inherited from class org.apache.hadoop.fs.shell.Command
displayError, displayError, displayWarning, exitCodeForError, expandArgument, expandArguments, getCommandFactory, getDepth, getDescription, getListingGroupSize, getName, getReplacementCommand, getUsage, isDeprecated, isPathRecursable, isRecursive, isSorted, postProcessPath, processArgument, processArguments, processNonexistentPath, processOptions, processPath, processPathArgument, processPaths, processPaths, recursePath, run, run, setCommandFactory, setName, setRecursiveMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
-
Constructor Details
-
FsCommand
protected FsCommand() -
FsCommand
-
-
Method Details
-
registerCommands
Register the command classes used by the fs subcommand- Parameters:
factory- where to register the class
-
getCommandName
- Specified by:
getCommandNamein classCommand- Returns:
- the command's name excluding the leading character -
-
run
Description copied from class:CommandExecute the command on the input path- Specified by:
runin classCommand- Parameters:
path- the input path- Throws:
IOException- if any error occurs
-
runAll
Deprecated.Description copied from class:CommandFor each source path, execute the command -
processRawArguments
Description copied from class:CommandAllows commands that don't use paths to handle the raw arguments. Default behavior is to expand the arguments viaCommand.expandArguments(LinkedList)and pass the resulting list toCommand.processArguments(LinkedList)- Overrides:
processRawArgumentsin classCommand- Parameters:
args- the list of argument strings- Throws:
IOException- raised on errors performing I/O.
-
Command.run(String...argv)