Find (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs.shell.find, class: Find

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`

@Private @Unstable public class Find extends FsCommand

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DESCRIPTION`
  `static final String`
  `NAME`
  `static final String`
  `USAGE`

  ### 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
  Constructor
  Description
  `Find()`
  Default constructor for the Find command.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `isPathRecursable(PathData item)`
  Determines whether a `PathData` item is recursable.
  `protected void`
  `postProcessPath(PathData item)`
  Hook for commands to implement an operation to be applied on each path for the command after being processed successfully
  `protected void`
  `processArguments(LinkedList<PathData> args)`
  Processes the command's list of expanded arguments.
  `protected void`
  `processOptions(LinkedList<String> args)`
  Must be implemented by commands to process the command line flags and check the bounds of the remaining arguments.
  `protected void`
  `processPath(PathData item)`
  Hook for commands to implement an operation to be applied on each path for the command.
  `protected void`
  `recursePath(PathData item)`
  Gets the directory listing for a path and invokes `Command.processPaths(PathData, PathData...)`
  `static void`
  `registerCommands(CommandFactory factory)`
  Register the names for the count command

  ### Methods inherited from class org.apache.hadoop.fs.shell.FsCommand

  `getCommandName, processRawArguments, run, runAll`

  ### Methods 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, setRecursive`

  ### Methods inherited from class org.apache.hadoop.conf.Configured

  `getConf, setConf`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### NAME

    public static final String NAME
    See Also:
      - Constant Field Values

  - ### USAGE

    public static final String USAGE
    See Also:
      - Constant Field Values

  - ### DESCRIPTION

    public static final String DESCRIPTION

- ## Constructor Details

  - ### Find

    public Find()
    Default constructor for the Find command.

- ## Method Details

  - ### registerCommands

    public static void registerCommands(CommandFactory factory)
    Register the names for the count command
    Parameters:
      `factory` - the command factory that will instantiate this class

  - ### processOptions

    protected void processOptions(LinkedList<String> args) throws IOException
    Description copied from class: `Command`
    Must 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:
      `processOptions` in class `Command`
    Parameters:
      `args` - the command line arguments
    Throws:
      `IOException` - raised on errors performing I/O.

  - ### recursePath

    protected void recursePath(PathData item) throws IOException
    Description copied from class: `Command`
    Gets the directory listing for a path and invokes `Command.processPaths(PathData, PathData...)`
    Overrides:
      `recursePath` in class `Command`
    Parameters:
      `item` - `PathData` for directory to recurse into
    Throws:
      `IOException` - if anything goes wrong...

  - ### isPathRecursable

    protected boolean isPathRecursable(PathData item) throws IOException
    Description copied from class: `Command`
    Determines whether a `PathData` item is recursable. Default implementation is to recurse directories but can be overridden to recurse through symbolic links.
    Overrides:
      `isPathRecursable` in class `Command`
    Parameters:
      `item` - a `PathData` object
    Returns:
      true if the item is recursable, false otherwise
    Throws:
      `IOException` - if anything goes wrong in the user-implementation

  - ### processPath

    protected void processPath(PathData item) throws IOException
    Description copied from class: `Command`
    Hook 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:
      `processPath` in class `Command`
    Parameters:
      `item` - a `PathData` object
    Throws:
      `IOException` - if anything else goes wrong in the user-implementation

  - ### postProcessPath

    protected void postProcessPath(PathData item) throws IOException
    Description copied from class: `Command`
    Hook for commands to implement an operation to be applied on each path for the command after being processed successfully
    Overrides:
      `postProcessPath` in class `Command`
    Parameters:
      `item` - a `PathData` object
    Throws:
      `IOException` - if anything goes wrong...

  - ### processArguments

    protected void processArguments(LinkedList<PathData> args) throws IOException
    Description copied from class: `Command`
    Processes 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:
      `processArguments` in class `Command`
    Parameters:
      `args` - a list of `PathData` to process
    Throws:
      `IOException` - if anything goes wrong...