Package net.rubyeye.xmemcached.impl
Class LibmemcachedMemcachedSessionLocator
- java.lang.Object
-
- net.rubyeye.xmemcached.impl.AbstractMemcachedSessionLocator
-
- net.rubyeye.xmemcached.impl.LibmemcachedMemcachedSessionLocator
-
- All Implemented Interfaces:
MemcachedSessionLocator
public class LibmemcachedMemcachedSessionLocator extends AbstractMemcachedSessionLocator
Consistent Hash Algorithm implementation is compatible with libmemcached method.- Author:
- dennis
-
-
Field Summary
-
Fields inherited from class net.rubyeye.xmemcached.impl.AbstractMemcachedSessionLocator
failureMode
-
-
Constructor Summary
Constructors Constructor Description LibmemcachedMemcachedSessionLocator()LibmemcachedMemcachedSessionLocator(int numReps, HashAlgorithm hashAlgorithm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessiongetSessionByHash(long hash)SessiongetSessionByKey(String key)Returns a session by special key.longnextHash(long hashVal, String key, int tries)voidupdateSessions(Collection<Session> list)Update sessions when session was added or removed.-
Methods inherited from class net.rubyeye.xmemcached.impl.AbstractMemcachedSessionLocator
setFailureMode
-
-
-
-
Constructor Detail
-
LibmemcachedMemcachedSessionLocator
public LibmemcachedMemcachedSessionLocator()
-
LibmemcachedMemcachedSessionLocator
public LibmemcachedMemcachedSessionLocator(int numReps, HashAlgorithm hashAlgorithm)
-
-
Method Detail
-
getSessionByKey
public final Session getSessionByKey(String key)
Description copied from interface:MemcachedSessionLocatorReturns a session by special key.- Returns:
-
getSessionByHash
public final Session getSessionByHash(long hash)
-
nextHash
public final long nextHash(long hashVal, String key, int tries)
-
updateSessions
public final void updateSessions(Collection<Session> list)
Description copied from interface:MemcachedSessionLocatorUpdate sessions when session was added or removed.- Parameters:
list- The newer sessions
-
-