org.apache.hadoop.fs.shell
Class Command

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.hadoop.fs.shell.Command
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
Count

public abstract class Command
extends Configured

An abstract class for the execution of a file system command


Field Summary
protected  String[] args
           
 
Constructor Summary
protected Command(Configuration conf)
          Constructor
 
Method Summary
abstract  String getCommandName()
          Return the command's name excluding the leading character -
protected abstract  void run(Path path)
          Execute the command on the input path
 int runAll()
          For each source path, execute the command
 
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

args

protected String[] args
Constructor Detail

Command

protected Command(Configuration conf)
Constructor

Method Detail

getCommandName

public abstract String getCommandName()
Return the command's name excluding the leading character -


run

protected abstract void run(Path path)
                     throws IOException
Execute the command on the input path

Parameters:
path - the input path
Throws:
IOException - if any error occurs

runAll

public int runAll()
For each source path, execute the command

Returns:
0 if it runs successfully; -1 if it fails


Copyright © 2009 The Apache Software Foundation