|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.util.ProcessTree
org.apache.hadoop.util.ProcfsBasedProcessTree
public class ProcfsBasedProcessTree
A Proc file-system based ProcessTree. Works only on Linux.
Field Summary | |
---|---|
static long |
DEFAULT_SLEEPTIME_BEFORE_SIGKILL
|
Fields inherited from class org.apache.hadoop.util.ProcessTree |
---|
isSetsidAvailable |
Constructor Summary | |
---|---|
ProcfsBasedProcessTree(String pid)
|
|
ProcfsBasedProcessTree(String pid,
boolean setsidUsed,
long sigkillInterval)
|
|
ProcfsBasedProcessTree(String pid,
String procfsDir)
|
Method Summary | |
---|---|
static void |
assertAndDestroyProcessGroup(String pgrpId,
long interval,
boolean inBackground)
Make sure that the given pid is a process group leader and then destroy the process group. |
void |
destroy()
Destroy the process-tree. |
void |
destroy(boolean inBackground)
Destroy the process-tree. |
long |
getCumulativeVmem()
Get the cumulative virtual memory used by all the processes in the process-tree. |
long |
getCumulativeVmem(int olderThanAge)
Get the cumulative virtual memory used by all the processes in the process-tree that are older than the passed in age. |
ProcfsBasedProcessTree |
getProcessTree()
Get the process-tree with latest state. |
String |
getProcessTreeDump()
Get a dump of the process-tree. |
boolean |
isAlive()
Is the root-process alive? |
boolean |
isAnyProcessInTreeAlive()
Is any of the subprocesses in the process-tree alive? |
static boolean |
isAvailable()
Checks if the ProcfsBasedProcessTree is available on this system. |
void |
setSigKillInterval(long interval)
Deprecated. Use ProcfsBasedProcessTree(
String, boolean, long) instead |
String |
toString()
Returns a string printing PIDs of process present in the ProcfsBasedProcessTree. |
Methods inherited from class org.apache.hadoop.util.ProcessTree |
---|
destroy, destroyProcess, destroyProcessGroup, isAlive, isProcessGroupAlive, killProcess, killProcessGroup, terminateProcess, terminateProcessGroup |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_SLEEPTIME_BEFORE_SIGKILL
Constructor Detail |
---|
public ProcfsBasedProcessTree(String pid)
public ProcfsBasedProcessTree(String pid, boolean setsidUsed, long sigkillInterval)
public ProcfsBasedProcessTree(String pid, String procfsDir)
Method Detail |
---|
public void setSigKillInterval(long interval)
ProcfsBasedProcessTree(
String, boolean, long)
instead
interval
- The time to wait before sending SIGKILL
after sending SIGTERMpublic static boolean isAvailable()
public ProcfsBasedProcessTree getProcessTree()
public boolean isAlive()
public boolean isAnyProcessInTreeAlive()
public static void assertAndDestroyProcessGroup(String pgrpId, long interval, boolean inBackground) throws IOException
pgrpId
- Process group id of to-be-killed-processesinterval
- The time to wait before sending SIGKILL
after sending SIGTERMinBackground
- Process is to be killed in the back ground with
a separate thread
IOException
public void destroy()
public void destroy(boolean inBackground)
inBackground
- Process is to be killed in the back ground with
a separate threadpublic String getProcessTreeDump()
public long getCumulativeVmem()
public long getCumulativeVmem(int olderThanAge)
olderThanAge
- processes above this age are included in the
memory addition
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |