public class LearnerSessionTracker extends UpgradeableSessionTracker
SessionTracker.Session, SessionTracker.SessionExpirerlocalSessionTracker| Constructor and Description |
|---|
LearnerSessionTracker(SessionTracker.SessionExpirer expirer,
ConcurrentMap<Long,Integer> sessionsWithTimeouts,
int tickTime,
long id,
boolean localSessionsEnabled,
ZooKeeperServerListener listener) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addGlobalSession(long sessionId,
int sessionTimeout)
Add a global session to those being tracked.
|
boolean |
addSession(long sessionId,
int sessionTimeout)
Add a session to those being tracked.
|
void |
checkSession(long sessionId,
Object owner)
Checks whether the SessionTracker is aware of this session, the session
is still active, and the owner matches.
|
long |
createSession(int sessionTimeout) |
void |
dumpSessions(PrintWriter pwriter)
Text dump of session information, suitable for debugging.
|
Map<Long,Set<Long>> |
getSessionExpiryMap()
Returns a mapping of time to session IDs that expire at that time.
|
boolean |
isGlobalSession(long sessionId) |
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() |
Map<Long,Integer> |
snapshot() |
void |
start() |
boolean |
touchSession(long sessionId,
int sessionTimeout) |
checkGlobalSession, createLocalSessionTracker, isLocalSession, isTrackingSession, upgradeSessionpublic LearnerSessionTracker(SessionTracker.SessionExpirer expirer, ConcurrentMap<Long,Integer> sessionsWithTimeouts, int tickTime, long id, boolean localSessionsEnabled, ZooKeeperServerListener listener)
public void removeSession(long sessionId)
public void start()
start in class UpgradeableSessionTrackerpublic void shutdown()
public boolean isGlobalSession(long sessionId)
isGlobalSession in class UpgradeableSessionTrackerpublic boolean addGlobalSession(long sessionId,
int sessionTimeout)
SessionTrackersessionId - sessionIdsessionTimeout - sessionTimeoutpublic boolean addSession(long sessionId,
int sessionTimeout)
SessionTrackersessionId - sessionIdsessionTimeout - sessionTimeoutpublic boolean touchSession(long sessionId,
int sessionTimeout)
public long createSession(int sessionTimeout)
public void checkSession(long sessionId,
Object owner)
throws KeeperException.SessionExpiredException,
KeeperException.SessionMovedException
SessionTrackerpublic void setOwner(long sessionId,
Object owner)
throws KeeperException.SessionExpiredException
public void dumpSessions(PrintWriter pwriter)
SessionTrackerpwriter - the output writerpublic void setSessionClosing(long sessionId)
SessionTrackerpublic Map<Long,Set<Long>> getSessionExpiryMap()
SessionTrackerCopyright © 2008–2019 The Apache Software Foundation. All rights reserved.