Package net.rubyeye.xmemcached.impl
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 int
private HashAlgorithm
private int
private int
private final Random
Fields inherited from class net.rubyeye.xmemcached.impl.AbstractMemcachedSessionLocator
failureMode
-
Constructor Summary
ConstructorsConstructorDescriptionLibmemcachedMemcachedSessionLocator
(int numReps, HashAlgorithm hashAlgorithm) -
Method Summary
Modifier and TypeMethodDescriptionprivate final void
buildMap
(Collection<Session> list, HashAlgorithm alg) final Session
getSessionByHash
(long hash) final Session
getSessionByKey
(String key) Returns a session by special key.getSessionList
(TreeMap<Long, List<Session>> sessionMap, long k) final long
final void
updateSessions
(Collection<Session> list) Update sessions when session was added or removed.Methods inherited from class net.rubyeye.xmemcached.impl.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:MemcachedSessionLocator
Returns a session by special key.- Parameters:
key
-- Returns:
-
getSessionByHash
-
nextHash
-
updateSessions
Description copied from interface:MemcachedSessionLocator
Update sessions when session was added or removed.- Parameters:
list
- The newer sessions
-