Class LearnerSessionTracker
- java.lang.Object
-
- org.apache.zookeeper.server.quorum.LearnerSessionTracker
-
- All Implemented Interfaces:
SessionTracker
public class LearnerSessionTracker extends java.lang.Object implements SessionTracker
This is really just a shell of a SessionTracker that tracks session activity to be forwarded to the Leader using a PING.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.zookeeper.server.SessionTracker
SessionTracker.Session, SessionTracker.SessionExpirer
-
-
Constructor Summary
Constructors Constructor Description LearnerSessionTracker(SessionTracker.SessionExpirer expirer, java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Integer> sessionsWithTimeouts, long id, ZooKeeperServerListener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSession(long sessionId, int sessionTimeout)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 sessionId, java.lang.Object owner)voidsetSessionClosing(long sessionId)Mark that the session is in the process of closing.voidshutdown()booleantouchSession(long sessionId, int sessionTimeout)
-
-
-
Constructor Detail
-
LearnerSessionTracker
public LearnerSessionTracker(SessionTracker.SessionExpirer expirer, java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Integer> sessionsWithTimeouts, long id, ZooKeeperServerListener listener)
-
-
Method Detail
-
removeSession
public void removeSession(long sessionId)
- Specified by:
removeSessionin interfaceSessionTracker
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceSessionTracker
-
addSession
public void addSession(long sessionId, int sessionTimeout)- Specified by:
addSessionin interfaceSessionTracker
-
touchSession
public boolean touchSession(long sessionId, int sessionTimeout)- Specified by:
touchSessionin interfaceSessionTracker- Returns:
- false if session is no longer active
-
createSession
public long createSession(int sessionTimeout)
- Specified by:
createSessionin interfaceSessionTracker
-
checkSession
public void checkSession(long sessionId, java.lang.Object owner)- Specified by:
checkSessionin interfaceSessionTracker
-
setOwner
public void setOwner(long sessionId, java.lang.Object owner)- Specified by:
setOwnerin interfaceSessionTracker
-
dumpSessions
public void dumpSessions(java.io.PrintWriter pwriter)
Description copied from interface:SessionTrackerText dump of session information, suitable for debugging.- Specified by:
dumpSessionsin interfaceSessionTracker- Parameters:
pwriter- the output writer
-
setSessionClosing
public void setSessionClosing(long sessionId)
Description copied from interface:SessionTrackerMark that the session is in the process of closing.- Specified by:
setSessionClosingin interfaceSessionTracker
-
-