Class LibmemcachedMemcachedSessionLocator
java.lang.Object
net.rubyeye.xmemcached.impl.AbstractMemcachedSessionLocator
net.rubyeye.xmemcached.impl.LibmemcachedMemcachedSessionLocator
- All Implemented Interfaces:
MemcachedSessionLocator
Consistent Hash Algorithm implementation is compatible with libmemcached method.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intprivate HashAlgorithmprivate intprivate intprivate final RandomFields inherited from class AbstractMemcachedSessionLocator
failureMode -
Constructor Summary
ConstructorsConstructorDescriptionLibmemcachedMemcachedSessionLocator(int numReps, HashAlgorithm hashAlgorithm) -
Method Summary
Modifier and TypeMethodDescriptionprivate final voidbuildMap(Collection<Session> list, HashAlgorithm alg) final SessiongetSessionByHash(long hash) final SessiongetSessionByKey(String key) Returns a session by special key.getSessionList(TreeMap<Long, List<Session>> sessionMap, long k) final longfinal voidupdateSessions(Collection<Session> list) Update sessions when session was added or removed.Methods inherited from class AbstractMemcachedSessionLocator
setFailureMode
-
Field Details
-
DEFAULT_NUM_REPS
static final int DEFAULT_NUM_REPS- See Also:
-
ketamaSessions
-
maxTries
private int maxTries -
numReps
private int numReps -
random
-
hashAlgorithm
-
-
Constructor Details
-
LibmemcachedMemcachedSessionLocator
public LibmemcachedMemcachedSessionLocator() -
LibmemcachedMemcachedSessionLocator
-
-
Method Details
-
buildMap
-
getSessionList
-
getSessionByKey
Description copied from interface:MemcachedSessionLocatorReturns a session by special key.- Parameters:
key-- Returns:
-
getSessionByHash
-
nextHash
-
updateSessions
Description copied from interface:MemcachedSessionLocatorUpdate sessions when session was added or removed.- Parameters:
list- The newer sessions
-