Package org.apache.hadoop.fs.shell.find
Class Find
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.shell.Command
org.apache.hadoop.fs.shell.FsCommand
org.apache.hadoop.fs.shell.find.Find
- All Implemented Interfaces:
Configurable
-
Field Summary
FieldsFields 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 booleanisPathRecursable(PathData item) Determines whether aPathDataitem is recursable.protected voidpostProcessPath(PathData item) Hook for commands to implement an operation to be applied on each path for the command after being processed successfullyprotected voidprocessArguments(LinkedList<PathData> args) Processes the command's list of expanded arguments.protected voidprocessOptions(LinkedList<String> args) Must be implemented by commands to process the command line flags and check the bounds of the remaining arguments.protected voidprocessPath(PathData item) Hook for commands to implement an operation to be applied on each path for the command.protected voidrecursePath(PathData item) Gets the directory listing for a path and invokesCommand.processPaths(PathData, PathData...)static voidregisterCommands(CommandFactory factory) Register the names for the count commandMethods inherited from class org.apache.hadoop.fs.shell.FsCommand
getCommandName, processRawArguments, run, runAllMethods inherited from class org.apache.hadoop.fs.shell.Command
displayError, displayError, displayWarning, exitCodeForError, expandArgument, expandArguments, getCommandFactory, getDepth, getDescription, getListingGroupSize, getName, getReplacementCommand, getUsage, isDeprecated, isRecursive, isSorted, processArgument, processNonexistentPath, processPathArgument, processPaths, processPaths, run, run, setCommandFactory, setName, setRecursiveMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
-
Field Details
-
NAME
- See Also:
-
USAGE
- See Also:
-
DESCRIPTION
-
-
Constructor Details
-
Find
public Find()Default constructor for the Find command.
-
-
Method Details
-
registerCommands
Register the names for the count command- Parameters:
factory- the command factory that will instantiate this class
-
processOptions
Description copied from class:CommandMust be implemented by commands to process the command line flags and check the bounds of the remaining arguments. If an IllegalArgumentException is thrown, the FsShell object will print the short usage of the command.- Overrides:
processOptionsin classCommand- Parameters:
args- the command line arguments- Throws:
IOException- raised on errors performing I/O.
-
recursePath
Description copied from class:CommandGets the directory listing for a path and invokesCommand.processPaths(PathData, PathData...)- Overrides:
recursePathin classCommand- Parameters:
item-PathDatafor directory to recurse into- Throws:
IOException- if anything goes wrong...
-
isPathRecursable
Description copied from class:CommandDetermines whether aPathDataitem is recursable. Default implementation is to recurse directories but can be overridden to recurse through symbolic links.- Overrides:
isPathRecursablein classCommand- Parameters:
item- aPathDataobject- Returns:
- true if the item is recursable, false otherwise
- Throws:
IOException- if anything goes wrong in the user-implementation
-
processPath
Description copied from class:CommandHook for commands to implement an operation to be applied on each path for the command. Note implementation of this method is optional if earlier methods in the chain handle the operation.- Overrides:
processPathin classCommand- Parameters:
item- aPathDataobject- Throws:
IOException- if anything else goes wrong in the user-implementation
-
postProcessPath
Description copied from class:CommandHook for commands to implement an operation to be applied on each path for the command after being processed successfully- Overrides:
postProcessPathin classCommand- Parameters:
item- aPathDataobject- Throws:
IOException- if anything goes wrong...
-
processArguments
Description copied from class:CommandProcesses the command's list of expanded arguments.Command.processArgument(PathData)will be invoked with each item in the list. The loop catches IOExceptions, increments the error count, and displays the exception.- Overrides:
processArgumentsin classCommand- Parameters:
args- a list ofPathDatato process- Throws:
IOException- if anything goes wrong...
-