public class ZooKeeperCleanup
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
appConf |
protected static long |
interval |
protected static long |
maxage |
static java.lang.String |
ZK_CLEANUP_INTERVAL |
static java.lang.String |
ZK_CLEANUP_MAX_AGE |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkAndDelete(java.lang.String node,
org.apache.zookeeper.ZooKeeper zk)
Check to see if a job is more than maxage old, and delete it if so.
|
void |
exit() |
java.util.List<java.lang.String> |
getChildList(org.apache.zookeeper.ZooKeeper zk)
Get the list of jobs from JobState
|
static ZooKeeperCleanup |
getInstance(Configuration appConf) |
void |
run()
Run the cleanup loop.
|
static void |
startInstance(Configuration appConf) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected Configuration appConf
public static final java.lang.String ZK_CLEANUP_INTERVAL
public static final java.lang.String ZK_CLEANUP_MAX_AGE
protected static long interval
protected static long maxage
public static ZooKeeperCleanup getInstance(Configuration appConf)
public static void startInstance(Configuration appConf)
throws java.io.IOException
java.io.IOExceptionpublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadjava.io.IOExceptionpublic java.util.List<java.lang.String> getChildList(org.apache.zookeeper.ZooKeeper zk)
java.io.IOExceptionpublic boolean checkAndDelete(java.lang.String node,
org.apache.zookeeper.ZooKeeper zk)
public void exit()
Copyright © 2012 The Apache Software Foundation