Class LocalSessionTracker
- java.lang.Object
-
- java.lang.Thread
-
- org.apache.zookeeper.server.ZooKeeperThread
-
- org.apache.zookeeper.server.ZooKeeperCriticalThread
-
- org.apache.zookeeper.server.SessionTrackerImpl
-
- org.apache.zookeeper.server.quorum.LocalSessionTracker
-
- All Implemented Interfaces:
java.lang.Runnable
,SessionTracker
public class LocalSessionTracker extends SessionTrackerImpl
Local session tracker.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.zookeeper.server.SessionTrackerImpl
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 org.apache.zookeeper.server.SessionTrackerImpl
sessionsById
-
-
Constructor Summary
Constructors Constructor Description LocalSessionTracker(SessionTracker.SessionExpirer expirer, java.util.concurrent.ConcurrentMap<java.lang.Long,java.lang.Integer> sessionsWithTimeouts, int tickTime, long id, ZooKeeperServerListener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addGlobalSession(long sessionId, int sessionTimeout)
Add a global session to those being tracked.boolean
isGlobalSession(long sessionId)
boolean
isLocalSession(long sessionId)
-
Methods inherited from class org.apache.zookeeper.server.SessionTrackerImpl
addSession, checkGlobalSession, checkSession, createSession, dumpSessions, getSessionExpiryMap, getSessionTimeout, initializeNextSession, isTrackingSession, removeSession, run, setOwner, setSessionClosing, shutdown, toString, touchSession
-
Methods inherited from class org.apache.zookeeper.server.ZooKeeperCriticalThread
handleException
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, 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, suspend, yield
-
-
-
-
Constructor Detail
-
LocalSessionTracker
public LocalSessionTracker(SessionTracker.SessionExpirer expirer, java.util.concurrent.ConcurrentMap<java.lang.Long,java.lang.Integer> sessionsWithTimeouts, int tickTime, long id, ZooKeeperServerListener listener)
-
-
Method Detail
-
isLocalSession
public boolean isLocalSession(long sessionId)
-
isGlobalSession
public boolean isGlobalSession(long sessionId)
-
addGlobalSession
public boolean addGlobalSession(long sessionId, int sessionTimeout)
Description copied from interface:SessionTracker
Add a global session to those being tracked.- Specified by:
addGlobalSession
in interfaceSessionTracker
- Overrides:
addGlobalSession
in classSessionTrackerImpl
- Parameters:
sessionId
- sessionIdsessionTimeout
- sessionTimeout- Returns:
- whether the session was newly added (if false, already existed)
-
-