org.apache.hadoop.fs.shell
Class Command

java.lang.Object
  extended by org.apache.hadoop.fs.shell.Command
Direct Known Subclasses:
Count

public abstract class Command
extends Object

An abstract class for the execution of a file system command


Field Summary
protected  String[] args
           
protected  FileSystem fs
           
 
Constructor Summary
protected Command(FileSystem fs)
          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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fs

protected final FileSystem fs

args

protected String[] args
Constructor Detail

Command

protected Command(FileSystem fs)
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 © 2008 The Apache Software Foundation