|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.apache.zookeeper.server.SessionTrackerImpl
public class SessionTrackerImpl
This is a full featured SessionTracker. It tracks session in grouped by tick interval. It always rounds up the tick interval to provide a sort of grace period. Sessions are thus expired in batches made up of sessions that expire in a given interval.
| Nested Class Summary | |
|---|---|
static class |
SessionTrackerImpl.SessionImpl
|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Nested classes/interfaces inherited from interface org.apache.zookeeper.server.SessionTracker |
|---|
SessionTracker.Session, SessionTracker.SessionExpirer |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
SessionTrackerImpl(SessionTracker.SessionExpirer expirer,
java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Integer> sessionsWithTimeout,
int tickTime,
long sid)
|
|
| Method Summary | |
|---|---|
void |
addSession(long id,
int sessionTimeout)
|
void |
checkSession(long sessionId,
java.lang.Object owner)
|
long |
createSession(int sessionTimeout)
|
void |
dumpSessions(java.io.PrintWriter pwriter)
Text dump of session information, suitable for debugging. |
static long |
initializeNextSession(long id)
|
void |
removeSession(long sessionId)
|
void |
run()
|
void |
setOwner(long id,
java.lang.Object owner)
|
void |
setSessionClosing(long sessionId)
Mark that the session is in the process of closing. |
void |
shutdown()
|
java.lang.String |
toString()
|
boolean |
touchSession(long sessionId,
int timeout)
|
| Methods inherited from class java.lang.Thread |
|---|
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, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SessionTrackerImpl(SessionTracker.SessionExpirer expirer,
java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Integer> sessionsWithTimeout,
int tickTime,
long sid)
| Method Detail |
|---|
public static long initializeNextSession(long id)
public void dumpSessions(java.io.PrintWriter pwriter)
SessionTracker
dumpSessions in interface SessionTrackerpwriter - the output writerpublic java.lang.String toString()
toString in class java.lang.Threadpublic void run()
run in interface java.lang.Runnablerun in class java.lang.Thread
public boolean touchSession(long sessionId,
int timeout)
touchSession in interface SessionTrackerpublic void setSessionClosing(long sessionId)
SessionTracker
setSessionClosing in interface SessionTrackerpublic void removeSession(long sessionId)
removeSession in interface SessionTrackerpublic void shutdown()
shutdown in interface SessionTrackerpublic long createSession(int sessionTimeout)
createSession in interface SessionTracker
public void addSession(long id,
int sessionTimeout)
addSession in interface SessionTracker
public void checkSession(long sessionId,
java.lang.Object owner)
throws KeeperException.SessionExpiredException,
KeeperException.SessionMovedException
checkSession in interface SessionTrackerKeeperException.SessionExpiredException
KeeperException.SessionMovedException
public void setOwner(long id,
java.lang.Object owner)
throws KeeperException.SessionExpiredException
setOwner in interface SessionTrackerKeeperException.SessionExpiredException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||