Package org.apache.zookeeper.server
Interface SessionTracker
-
- All Known Implementing Classes:
LearnerSessionTracker,SessionTrackerImpl
public interface SessionTrackerThis 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 interfaceSessionTracker.Sessionstatic interfaceSessionTracker.SessionExpirer
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddSession(long id, int to)voidcheckSession(long sessionId, java.lang.Object owner)longcreateSession(int sessionTimeout)voiddumpSessions(java.io.PrintWriter pwriter)Text dump of session information, suitable for debugging.voidremoveSession(long sessionId)voidsetOwner(long id, java.lang.Object owner)voidsetSessionClosing(long sessionId)Mark that the session is in the process of closing.voidshutdown()booleantouchSession(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
-
-