@InterfaceAudience.LimitedPrivate(value={"HDFS","MapReduce"}) @InterfaceStability.Evolving public class DU extends Shell
Shell.ExitCodeException, Shell.ShellCommandExecutor
isSetsidAvailable, LINK_COMMAND, LINUX, LOG, READ_LINK_COMMAND, SET_GROUP_COMMAND, SET_OWNER_COMMAND, SET_PERMISSION_COMMAND, timeOutInterval, TOKEN_SEPARATOR_REGEX, USER_NAME_COMMAND, WINDOWS, WindowsProcessLaunchLock, WINUTILS
Constructor and Description |
---|
DU(File path,
Configuration conf)
Keeps track of disk usage.
|
DU(File path,
long interval)
Keeps track of disk usage.
|
Modifier and Type | Method and Description |
---|---|
void |
decDfsUsed(long value)
Decrease how much disk space we use.
|
String |
getDirPath() |
protected String[] |
getExecString()
return an array containing the command name & its parameters
|
long |
getUsed() |
void |
incDfsUsed(long value)
Increase how much disk space we use.
|
static void |
main(String[] args) |
protected void |
parseExecResult(BufferedReader lines)
Parse the execution result
|
protected void |
run()
Override to hook in DUHelper class.
|
void |
shutdown()
Shut down the refreshing thread.
|
void |
start()
Start the disk usage checking thread.
|
String |
toString() |
appendScriptExtension, appendScriptExtension, execCommand, execCommand, execCommand, getCheckProcessIsAliveCommand, getEnvironmentVariableRegex, getExitCode, getGetPermissionCommand, getGroupsCommand, getGroupsForUserCommand, getHadoopHome, getProcess, getQualifiedBinPath, getReadlinkCommand, getRunScriptCommand, getSetOwnerCommand, getSetPermissionCommand, getSetPermissionCommand, getSignalKillCommand, getSymlinkCommand, getUsersForNetgroupCommand, getWinUtilsPath, isJava7OrAbove, isTimedOut, setEnvironment, setWorkingDirectory
public DU(File path, long interval) throws IOException
path
- the path to check disk usage ininterval
- refresh the disk usage at this intervalIOException
- if we fail to refresh the disk usagepublic DU(File path, Configuration conf) throws IOException
path
- the path to check disk usage inconf
- configuration objectIOException
- if we fail to refresh the disk usagepublic void decDfsUsed(long value)
value
- decrease by this valuepublic void incDfsUsed(long value)
value
- increase by this valuepublic long getUsed() throws IOException
IOException
- if the shell command failspublic String getDirPath()
protected void run() throws IOException
run
in class Shell
IOException
public void start()
public void shutdown()
protected String[] getExecString()
Shell
getExecString
in class Shell
protected void parseExecResult(BufferedReader lines) throws IOException
Shell
parseExecResult
in class Shell
IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.