org.apache.hadoop.fs
Class DF

java.lang.Object
  extended by org.apache.hadoop.util.Shell
      extended by org.apache.hadoop.fs.DF

public class DF
extends Shell

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


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.util.Shell
Shell.ExitCodeException, Shell.ShellCommandExecutor
 
Field Summary
static long DF_INTERVAL_DEFAULT
           
 
Fields inherited from class org.apache.hadoop.util.Shell
LOG, SET_GROUP_COMMAND, SET_OWNER_COMMAND, SET_PERMISSION_COMMAND, USER_NAME_COMMAND, WINDOWS
 
Constructor Summary
DF(java.io.File path, Configuration conf)
           
DF(java.io.File path, long dfInterval)
           
 
Method Summary
 long getAvailable()
           
 long getCapacity()
           
 java.lang.String getDirPath()
           
protected  java.lang.String[] getExecString()
          return an array containing the command name & its parameters
 java.lang.String getFilesystem()
           
 java.lang.String getMount()
           
 int getPercentUsed()
           
 long getUsed()
           
static void main(java.lang.String[] args)
           
protected  void parseExecResult(java.io.BufferedReader lines)
          Parse the execution result
 java.lang.String toString()
           
 
Methods inherited from class org.apache.hadoop.util.Shell
execCommand, execCommand, getExitCode, getGET_PERMISSION_COMMAND, getGROUPS_COMMAND, getProcess, getUlimitMemoryCommand, run, setEnvironment, setWorkingDirectory
 
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(java.io.File path,
          Configuration conf)
   throws java.io.IOException
Throws:
java.io.IOException

DF

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

getDirPath

public java.lang.String getDirPath()

getFilesystem

public java.lang.String getFilesystem()
                               throws java.io.IOException
Throws:
java.io.IOException

getCapacity

public long getCapacity()
                 throws java.io.IOException
Throws:
java.io.IOException

getUsed

public long getUsed()
             throws java.io.IOException
Throws:
java.io.IOException

getAvailable

public long getAvailable()
                  throws java.io.IOException
Throws:
java.io.IOException

getPercentUsed

public int getPercentUsed()
                   throws java.io.IOException
Throws:
java.io.IOException

getMount

public java.lang.String getMount()
                          throws java.io.IOException
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getExecString

protected java.lang.String[] getExecString()
Description copied from class: Shell
return an array containing the command name & its parameters

Specified by:
getExecString in class Shell

parseExecResult

protected void parseExecResult(java.io.BufferedReader lines)
                        throws java.io.IOException
Description copied from class: Shell
Parse the execution result

Specified by:
parseExecResult in class Shell
Throws:
java.io.IOException

main

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


Copyright © 2009 The Apache Software Foundation