org.apache.hadoop.fs
Class DF
java.lang.Object
org.apache.hadoop.util.Shell
org.apache.hadoop.fs.DF
public class DF
- extends Shell
Filesystem disk space usage statistics. Uses the unix 'df' program to get
mount points, and java.io.File for space utilization. Tested on Linux,
FreeBSD, Cygwin.
| Methods inherited from class org.apache.hadoop.util.Shell |
execCommand, execCommand, execCommand, getExitCode, getGET_PERMISSION_COMMAND, getGroupsCommand, getGroupsForUserCommand, getProcess, getUlimitMemoryCommand, getUlimitMemoryCommand, getUsersForNetgroupCommand, isTimedOut, run, setEnvironment, setWorkingDirectory |
DF_INTERVAL_DEFAULT
public static final long DF_INTERVAL_DEFAULT
- Default DF refresh interval.
- See Also:
- Constant Field Values
DF
public DF(File path,
Configuration conf)
throws IOException
- Throws:
IOException
DF
public DF(File path,
long dfInterval)
throws IOException
- Throws:
IOException
getDirPath
public String getDirPath()
- Returns:
- the canonical path to the volume we're checking.
getFilesystem
public String getFilesystem()
throws IOException
- Returns:
- a string indicating which filesystem volume we're checking.
- Throws:
IOException
getCapacity
public long getCapacity()
- Returns:
- the capacity of the measured filesystem in bytes.
getUsed
public long getUsed()
- Returns:
- the total used space on the filesystem in bytes.
getAvailable
public long getAvailable()
- Returns:
- the usable space remaining on the filesystem in bytes.
getPercentUsed
public int getPercentUsed()
- Returns:
- the amount of the volume full, as a percent.
getMount
public String getMount()
throws IOException
- Returns:
- the filesystem mount point for the indicated volume
- Throws:
IOException
toString
public String toString()
- Overrides:
toString in class Object
getExecString
protected 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(BufferedReader lines)
throws IOException
- Description copied from class:
Shell
- Parse the execution result
- Specified by:
parseExecResult in class Shell
- Throws:
IOException
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 2009 The Apache Software Foundation