|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.util.ProcessTree
public class ProcessTree
Process tree related operations
Field Summary | |
---|---|
static long |
DEFAULT_SLEEPTIME_BEFORE_SIGKILL
|
static boolean |
isSetsidAvailable
|
Constructor Summary | |
---|---|
ProcessTree()
|
Method Summary | |
---|---|
static void |
destroy(String pid,
long sleeptimeBeforeSigkill,
boolean isProcessGroup,
boolean inBackground)
Destroy the process-tree. |
protected static void |
destroyProcess(String pid,
long sleeptimeBeforeSigkill,
boolean inBackground)
Destroy the process. |
protected static void |
destroyProcessGroup(String pgrpId,
long sleeptimeBeforeSigkill,
boolean inBackground)
Destroy the process group. |
static boolean |
isAlive(String pid)
Is the process with PID pid still alive? This method assumes that isAlive is called on a pid that was alive not too long ago, and hence assumes no chance of pid-wrapping-around. |
static boolean |
isProcessGroupAlive(String pgrpId)
Is the process group with still alive? This method assumes that isAlive is called on a pid that was alive not too long ago, and hence assumes no chance of pid-wrapping-around. |
static void |
killProcess(String pid)
Sends kill signal to process, forcefully terminating the process. |
static void |
killProcessGroup(String pgrpId)
Sends kill signal to all process belonging to same process group, forcefully terminating the process group. |
static void |
terminateProcess(String pid)
Sends terminate signal to the process, allowing it to gracefully exit. |
static void |
terminateProcessGroup(String pgrpId)
Sends terminate signal to all the process belonging to the passed process group, allowing the group to gracefully exit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_SLEEPTIME_BEFORE_SIGKILL
public static final boolean isSetsidAvailable
Constructor Detail |
---|
public ProcessTree()
Method Detail |
---|
public static void destroy(String pid, long sleeptimeBeforeSigkill, boolean isProcessGroup, boolean inBackground)
pid
- process id of the root process of the subtree of processes
to be killedsleeptimeBeforeSigkill
- The time to wait before sending SIGKILL
after sending SIGTERMisProcessGroup
- pid is a process group leader or notinBackground
- Process is to be killed in the back ground with
a separate threadprotected static void destroyProcess(String pid, long sleeptimeBeforeSigkill, boolean inBackground)
pid
- Process id of to-be-killed-processsleeptimeBeforeSigkill
- The time to wait before sending SIGKILL
after sending SIGTERMinBackground
- Process is to be killed in the back ground with
a separate threadprotected static void destroyProcessGroup(String pgrpId, long sleeptimeBeforeSigkill, boolean inBackground)
pgrpId
- Process group id of to-be-killed-processessleeptimeBeforeSigkill
- The time to wait before sending SIGKILL
after sending SIGTERMinBackground
- Process group is to be killed in the back ground with
a separate threadpublic static void terminateProcess(String pid)
pid
- pid of the process to be sent SIGTERMpublic static void terminateProcessGroup(String pgrpId)
pgrpId
- process group idpublic static void killProcess(String pid)
pid
- process idpublic static void killProcessGroup(String pgrpId)
pgrpId
- process group idpublic static boolean isAlive(String pid)
pid
- pid of the process to check.
public static boolean isProcessGroupAlive(String pgrpId)
pgrpId
- process group id
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |