## org.apache.hadoop.fs.shell
Class Count

    java.lang.Object
      org.apache.hadoop.conf.Configured
          org.apache.hadoop.fs.shell.Command
              org.apache.hadoop.fs.shell.Count

All Implemented Interfaces:
  Configurable

    public class Count

extends Command

Count the number of directories, files, bytes, quota, and remaining quota.

Field Summary
`static String` `DESCRIPTION`
`static String` `NAME`
`static String` `USAGE`

Fields inherited from class org.apache.hadoop.fs.shell.Command
`args`

Constructor Summary
`Count(String[] cmd, int pos, Configuration conf)` Constructor

Method Summary
`String` `getCommandName()` Return the command's name excluding the leading character -
`static boolean` `matches(String cmd)` Check if a command is the count command
`protected void` `run(Path path)` Execute the command on the input path

Methods inherited from class org.apache.hadoop.fs.shell.Command
`runAll`

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 Detail

### 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 Detail

### Count

    public Count(String[] cmd,
                 int pos,
                 Configuration conf)

  Constructor

  Parameters:
    `cmd` - the count command
    `pos` - the starting index of the arguments

Method Detail

### matches

    public static boolean matches(String cmd)

  Check if a command is the count command

  Parameters:
    `cmd` - A string representation of a command starting with "-"
  Returns:
    true if this is a count command; false otherwise

### getCommandName

    public String getCommandName()

  Description copied from class: `Command`
  Return the command's name excluding the leading character -

  Specified by:
    `getCommandName` in class `Command`

### run

    protected void run(Path path)
                throws IOException

  Description copied from class: `Command`
  Execute the command on the input path

  Specified by:
    `run` in class `Command`
  Parameters:
    `path` - the input path
  Throws:
    `IOException` - if any error occurs

Copyright © 2009 The Apache Software Foundation