public class KetamaConnectionFactory extends DefaultConnectionFactory
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.
DEFAULT_AUTH_WAIT_TIME, DEFAULT_CLIENT_MODE, DEFAULT_FAILURE_MODE, DEFAULT_HASH, DEFAULT_MAX_RECONNECT_DELAY, DEFAULT_MAX_TIMEOUTEXCEPTION_THRESHOLD, DEFAULT_METRIC_TYPE, DEFAULT_OP_QUEUE_LEN, DEFAULT_OP_QUEUE_MAX_BLOCK_TIME, DEFAULT_OPERATION_TIMEOUT, DEFAULT_READ_BUFFER_SIZE, opQueueLen| Constructor and Description |
|---|
KetamaConnectionFactory()
Create a KetamaConnectionFactory with the default parameters.
|
KetamaConnectionFactory(ClientMode clientMode,
int qLen,
int bufSize,
long opQueueMaxBlockTime)
Create a KetamaConnectionFactory with the given maximum operation
queue length, and the given read buffer size.
|
KetamaConnectionFactory(int qLen,
int bufSize,
long opQueueMaxBlockTime) |
KetamaConnectionFactory(int qLen,
int bufSize,
long opQueueMaxBlockTime,
HashAlgorithm hash,
KetamaNodeKeyFormatter.Format nodeKeyFormat,
java.util.Map<java.net.InetSocketAddress,java.lang.Integer> weights)
Create a KetamaConnectionFactory with the maximum operation queue length,
the given read buffer size, the maximum time to block waiting operations,
a specific hash algorithm, a set ring key format, and a given set of
weights.
|
| Modifier and Type | Method and Description |
|---|---|
NodeLocator |
createLocator(java.util.List<MemcachedNode> nodes)
Create a NodeLocator instance for the given list of nodes.
|
KetamaNodeKeyFormatter.Format |
getKetamaNodeKeyFormat() |
java.util.Map<java.net.InetSocketAddress,java.lang.Integer> |
getWeights() |
createConnection, createMemcachedNode, createOperationQueue, createReadOperationQueue, createWriteOperationQueue, enableMetrics, getAuthDescriptor, getAuthWaitTime, getClientMode, getDefaultTranscoder, getDynamicModePollingInterval, getFailureMode, getHashAlg, getHostnameForTlsVerification, getInitialObservers, getKeepAlive, getListenerExecutorService, getMaxReconnectDelay, getMetricCollector, getName, getOperationFactory, getOperationTimeout, getOpQueueLen, getOpQueueMaxBlockTime, getReadBufSize, getSSLContext, getTimeoutExceptionThreshold, isDaemon, isDefaultExecutorService, setClientMode, shouldOptimize, skipTlsHostnameVerification, toString, useNagleAlgorithmpublic KetamaConnectionFactory(ClientMode clientMode, int qLen, int bufSize, long opQueueMaxBlockTime)
opQueueMaxBlockTime - the maximum time to block waiting for op
queue operations to complete, in millisecondspublic KetamaConnectionFactory(int qLen,
int bufSize,
long opQueueMaxBlockTime)
public KetamaConnectionFactory(int qLen,
int bufSize,
long opQueueMaxBlockTime,
HashAlgorithm hash,
KetamaNodeKeyFormatter.Format nodeKeyFormat,
java.util.Map<java.net.InetSocketAddress,java.lang.Integer> weights)
public KetamaConnectionFactory()
public NodeLocator createLocator(java.util.List<MemcachedNode> nodes)
ConnectionFactorycreateLocator in interface ConnectionFactorycreateLocator in class DefaultConnectionFactorypublic KetamaNodeKeyFormatter.Format getKetamaNodeKeyFormat()
public java.util.Map<java.net.InetSocketAddress,java.lang.Integer> getWeights()
Copyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.