org.apache.zookeeper.server.quorum
Class LearnerSessionTracker

java.lang.Object
  extended by org.apache.zookeeper.server.quorum.LearnerSessionTracker
All Implemented Interfaces:
SessionTracker

public class LearnerSessionTracker
extends 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
LearnerSessionTracker(SessionTracker.SessionExpirer expirer, ConcurrentHashMap<Long,Integer> sessionsWithTimeouts, long id)
           
 
Method Summary
 void addSession(long sessionId, int sessionTimeout)
           
 void checkSession(long sessionId, Object owner)
           
 long createSession(int sessionTimeout)
           
 void dumpSessions(PrintWriter pwriter)
          Text dump of session information, suitable for debugging.
 void removeSession(long sessionId)
           
 void setOwner(long sessionId, Object owner)
           
 void setSessionClosing(long sessionId)
          Mark that the session is in the process of closing.
 void shutdown()
           
 boolean touchSession(long sessionId, int sessionTimeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LearnerSessionTracker

public LearnerSessionTracker(SessionTracker.SessionExpirer expirer,
                             ConcurrentHashMap<Long,Integer> sessionsWithTimeouts,
                             long id)
Method Detail

removeSession

public void removeSession(long sessionId)
Specified by:
removeSession in interface SessionTracker

shutdown

public void shutdown()
Specified by:
shutdown in interface SessionTracker

addSession

public void addSession(long sessionId,
                       int sessionTimeout)
Specified by:
addSession in interface SessionTracker

touchSession

public boolean touchSession(long sessionId,
                            int sessionTimeout)
Specified by:
touchSession in interface SessionTracker
Returns:
false if session is no longer active

createSession

public long createSession(int sessionTimeout)
Specified by:
createSession in interface SessionTracker

checkSession

public void checkSession(long sessionId,
                         Object owner)
Specified by:
checkSession in interface SessionTracker

setOwner

public void setOwner(long sessionId,
                     Object owner)
Specified by:
setOwner in interface SessionTracker

dumpSessions

public void dumpSessions(PrintWriter pwriter)
Description copied from interface: SessionTracker
Text dump of session information, suitable for debugging.

Specified by:
dumpSessions in interface SessionTracker
Parameters:
pwriter - the output writer

setSessionClosing

public void setSessionClosing(long sessionId)
Description copied from interface: SessionTracker
Mark that the session is in the process of closing.

Specified by:
setSessionClosing in interface SessionTracker


Copyright © 2011 The Apache Software Foundation