java.lang.Runnable
, SessionTracker
public class SessionTrackerImpl extends ZooKeeperCriticalThread implements SessionTracker
Modifier and Type | Class | Description |
---|---|---|
static class |
SessionTrackerImpl.SessionImpl |
SessionTracker.Session, SessionTracker.SessionExpirer
Constructor | Description |
---|---|
SessionTrackerImpl(SessionTracker.SessionExpirer expirer,
java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Integer> sessionsWithTimeout,
int tickTime,
long sid,
ZooKeeperServerListener listener) |
Modifier and Type | Method | Description |
---|---|---|
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) |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
handleException
public SessionTrackerImpl(SessionTracker.SessionExpirer expirer, java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Integer> sessionsWithTimeout, int tickTime, long sid, ZooKeeperServerListener listener)
public static long initializeNextSession(long id)
public void dumpSessions(java.io.PrintWriter pwriter)
SessionTracker
dumpSessions
in interface SessionTracker
pwriter
- the output writerpublic java.lang.String toString()
toString
in class java.lang.Thread
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public boolean touchSession(long sessionId, int timeout)
touchSession
in interface SessionTracker
public void setSessionClosing(long sessionId)
SessionTracker
setSessionClosing
in interface SessionTracker
public void removeSession(long sessionId)
removeSession
in interface SessionTracker
public void shutdown()
shutdown
in interface SessionTracker
public 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 SessionTracker
KeeperException.SessionExpiredException
KeeperException.SessionMovedException
public void setOwner(long id, java.lang.Object owner) throws KeeperException.SessionExpiredException
setOwner
in interface SessionTracker
KeeperException.SessionExpiredException
Copyright © 2018 The Apache Software Foundation