Package org.apache.zookeeper.server
Interface SessionTracker
-
- All Known Implementing Classes:
LearnerSessionTracker
,SessionTrackerImpl
public interface SessionTracker
This is the basic interface that ZooKeeperServer uses to track sessions. The standalone and leader ZooKeeperServer use the same SessionTracker. The FollowerZooKeeperServer uses a SessionTracker which is basically a simple shell to track information to be forwarded to the leader.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SessionTracker.Session
static interface
SessionTracker.SessionExpirer
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addSession(long id, int to)
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.void
removeSession(long sessionId)
void
setOwner(long id, java.lang.Object owner)
void
setSessionClosing(long sessionId)
Mark that the session is in the process of closing.void
shutdown()
boolean
touchSession(long sessionId, int sessionTimeout)
-
-
-
Method Detail
-
createSession
long createSession(int sessionTimeout)
-
addSession
void addSession(long id, int to)
-
touchSession
boolean touchSession(long sessionId, int sessionTimeout)
- Parameters:
sessionId
-sessionTimeout
-- Returns:
- false if session is no longer active
-
setSessionClosing
void setSessionClosing(long sessionId)
Mark that the session is in the process of closing.- Parameters:
sessionId
-
-
shutdown
void shutdown()
-
removeSession
void removeSession(long sessionId)
- Parameters:
sessionId
-
-
checkSession
void checkSession(long sessionId, java.lang.Object owner) throws KeeperException.SessionExpiredException, KeeperException.SessionMovedException
-
setOwner
void setOwner(long id, java.lang.Object owner) throws KeeperException.SessionExpiredException
-
dumpSessions
void dumpSessions(java.io.PrintWriter pwriter)
Text dump of session information, suitable for debugging.- Parameters:
pwriter
- the output writer
-
-