org.apache.hadoop.fs
Class DF

java.lang.Object
  extended by org.apache.hadoop.fs.ShellCommand
      extended by org.apache.hadoop.fs.DF

public class DF
extends ShellCommand

Filesystem disk space usage statistics. Uses the unix 'df' program. Tested on Linux, FreeBSD, Cygwin.


Field Summary
static long DF_INTERVAL_DEFAULT
           
 
Constructor Summary
DF(File path, Configuration conf)
           
DF(File path, long dfInterval)
           
 
Method Summary
 long getAvailable()
           
 long getCapacity()
           
 String getDirPath()
           
protected  String[] getExecString()
          return an array comtaining the command name & its parameters
 String getFilesystem()
           
 String getMount()
           
 int getPercentUsed()
           
 long getUsed()
           
static void main(String[] args)
           
protected  void parseExecResult(BufferedReader lines)
          Parse the execution result
 String toString()
           
 
Methods inherited from class org.apache.hadoop.fs.ShellCommand
execCommand, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DF_INTERVAL_DEFAULT

public static final long DF_INTERVAL_DEFAULT
See Also:
Constant Field Values
Constructor Detail

DF

public DF(File path,
          Configuration conf)
   throws IOException
Throws:
IOException

DF

public DF(File path,
          long dfInterval)
   throws IOException
Throws:
IOException
Method Detail

getDirPath

public String getDirPath()

getFilesystem

public String getFilesystem()
                     throws IOException
Throws:
IOException

getCapacity

public long getCapacity()
                 throws IOException
Throws:
IOException

getUsed

public long getUsed()
             throws IOException
Throws:
IOException

getAvailable

public long getAvailable()
                  throws IOException
Throws:
IOException

getPercentUsed

public int getPercentUsed()
                   throws IOException
Throws:
IOException

getMount

public String getMount()
                throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

getExecString

protected String[] getExecString()
Description copied from class: ShellCommand
return an array comtaining the command name & its parameters

Specified by:
getExecString in class ShellCommand

parseExecResult

protected void parseExecResult(BufferedReader lines)
                        throws IOException
Description copied from class: ShellCommand
Parse the execution result

Specified by:
parseExecResult in class ShellCommand
Throws:
IOException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2006 The Apache Software Foundation