public class KetamaMemcachedSessionLocator extends AbstractMemcachedSessionLocator
failureMode
Constructor and Description |
---|
KetamaMemcachedSessionLocator()
Create a KetamaMemcachedSessionLocator with default config.
|
KetamaMemcachedSessionLocator(boolean cwNginxUpstreamConsistent)
Create a KetamaMemcachedSessionLocator
|
KetamaMemcachedSessionLocator(HashAlgorithm alg)
Create a KetamaMemcachedSessionLocator with a special hash algorithm.
|
KetamaMemcachedSessionLocator(HashAlgorithm alg,
boolean cwNginxUpstreamConsistent) |
KetamaMemcachedSessionLocator(HashAlgorithm alg,
boolean cwNginxUpstreamConsistent,
boolean gwhalinMemcachedJavaClientCompatibiltyConsistent) |
KetamaMemcachedSessionLocator(List<Session> list,
HashAlgorithm alg) |
Modifier and Type | Method and Description |
---|---|
Session |
getSessionByHash(long hash) |
Session |
getSessionByKey(String key)
Returns a session by special key.
|
long |
nextHash(long hashVal,
String key,
int tries) |
void |
updateSessions(Collection<Session> list)
Update sessions when session was added or removed.
|
setFailureMode
public KetamaMemcachedSessionLocator()
public KetamaMemcachedSessionLocator(boolean cwNginxUpstreamConsistent)
cwNginxUpstreamConsistent
- true if compatible with nginx up stream memcached consistent
algorithm.public KetamaMemcachedSessionLocator(HashAlgorithm alg)
alg
- public KetamaMemcachedSessionLocator(HashAlgorithm alg, boolean cwNginxUpstreamConsistent)
public KetamaMemcachedSessionLocator(HashAlgorithm alg, boolean cwNginxUpstreamConsistent, boolean gwhalinMemcachedJavaClientCompatibiltyConsistent)
public KetamaMemcachedSessionLocator(List<Session> list, HashAlgorithm alg)
public final Session getSessionByKey(String key)
MemcachedSessionLocator
public final Session getSessionByHash(long hash)
public final long nextHash(long hashVal, String key, int tries)
public final void updateSessions(Collection<Session> list)
MemcachedSessionLocator
list
- The newer sessionsCopyright © 2021. All rights reserved.