net.spy.memcached
Class KetamaConnectionFactory
java.lang.Object
net.spy.memcached.compat.SpyObject
net.spy.memcached.DefaultConnectionFactory
net.spy.memcached.KetamaConnectionFactory
- All Implemented Interfaces:
- ConnectionFactory
public class KetamaConnectionFactory
- extends DefaultConnectionFactory
ConnectionFactory instance that sets up a ketama compatible connection.
This implementation piggy-backs on the functionality of the
DefaultConnectionFactory in terms of connections and queue
handling. Where it differs is that it uses both the
KetamaNodeLocator and the HashAlgorithm.KETAMA_HASH
to provide consistent node hashing.
- See Also:
- RJ's blog post
|
Constructor Summary |
KetamaConnectionFactory()
Create a KetamaConnectionFactory with the default parameters. |
KetamaConnectionFactory(int qLen,
int bufSize,
long opQueueMaxBlockTime)
Create a KetamaConnectionFactory with the given maximum operation
queue length, and the given read buffer size. |
| Methods inherited from class net.spy.memcached.DefaultConnectionFactory |
createConnection, createMemcachedNode, createOperationQueue, createReadOperationQueue, createWriteOperationQueue, getAuthDescriptor, getDefaultTranscoder, getFailureMode, getHashAlg, getInitialObservers, getMaxReconnectDelay, getName, getOperationFactory, getOperationTimeout, getOpQueueLen, getOpQueueMaxBlockTime, getReadBufSize, getTimeoutExceptionThreshold, isDaemon, shouldOptimize, toString, useNagleAlgorithm |
KetamaConnectionFactory
public KetamaConnectionFactory(int qLen,
int bufSize,
long opQueueMaxBlockTime)
- Create a KetamaConnectionFactory with the given maximum operation
queue length, and the given read buffer size.
- Parameters:
opQueueMaxBlockTime - the maximum time to block waiting for op
queue operations to complete, in milliseconds
KetamaConnectionFactory
public KetamaConnectionFactory()
- Create a KetamaConnectionFactory with the default parameters.
createLocator
public NodeLocator createLocator(List<MemcachedNode> nodes)
- Description copied from interface:
ConnectionFactory
- Create a NodeLocator instance for the given list of nodes.
- Specified by:
createLocator in interface ConnectionFactory- Overrides:
createLocator in class DefaultConnectionFactory