Package net.rubyeye.xmemcached.impl
Class ArrayMemcachedSessionLocator
java.lang.Object
net.rubyeye.xmemcached.impl.AbstractMemcachedSessionLocator
net.rubyeye.xmemcached.impl.ArrayMemcachedSessionLocator
- All Implemented Interfaces:
MemcachedSessionLocator
Session locator base on hash(key) mod sessions.size().Standard hash strategy
-
Field Summary
FieldsFields inherited from class net.rubyeye.xmemcached.impl.AbstractMemcachedSessionLocator
failureMode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal long
final long
getNext
(int size, long start) private Session
getRandomSession
(List<Session> sessions) final Session
getSessionByKey
(String key) Returns a session by special key.final void
setHashAlgorighm
(HashAlgorithm hashAlgorighm) 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
-
hashAlgorighm
-
sessions
-
rand
-
-
Constructor Details
-
ArrayMemcachedSessionLocator
public ArrayMemcachedSessionLocator() -
ArrayMemcachedSessionLocator
-
-
Method Details
-
setHashAlgorighm
-
getHash
-
getSessionByKey
Description copied from interface:MemcachedSessionLocator
Returns a session by special key.- Parameters:
key
-- Returns:
-
getRandomSession
-
getNext
public final long getNext(int size, long start) -
updateSessions
Description copied from interface:MemcachedSessionLocator
Update sessions when session was added or removed.- Parameters:
list
- The newer sessions
-