public class CouchbaseConnectionFactory extends BinaryConnectionFactory
This implementation creates connections where the operation queue is an
ArrayBlockingQueue and the read and write queues are unbounded
LinkedBlockingQueues. The Retry FailureMode and
KetamaHash VBucket hashing mechanism are always used. If other
configurations are needed, look at the ConnectionFactoryBuilder.
| Modifier and Type | Field and Description |
|---|---|
protected ConfigurationProvider |
configurationProvider |
static FailureMode |
DEFAULT_FAILURE_MODE
Default failure mode.
|
static HashAlgorithm |
DEFAULT_HASH
Default hash algorithm.
|
static long |
DEFAULT_MIN_RECONNECT_INTERVAL
Specify a default minimum reconnect interval of 1.1s.
|
static long |
DEFAULT_OBS_POLL_INTERVAL
Default Observe poll interval in ms.
|
static int |
DEFAULT_OBS_POLL_MAX
Default maximum amount of poll cycles before failure.
|
static int |
DEFAULT_OP_QUEUE_LEN
Maximum length of the operation queue returned by this connection factory.
|
static int |
DEFAULT_VIEW_TIMEOUT
Default View request timeout in ms.
|
DEFAULT_MAX_RECONNECT_DELAY, DEFAULT_MAX_TIMEOUTEXCEPTION_THRESHOLD, DEFAULT_OP_QUEUE_MAX_BLOCK_TIME, DEFAULT_OPERATION_TIMEOUT, DEFAULT_READ_BUFFER_SIZE, opQueueLen| Constructor and Description |
|---|
CouchbaseConnectionFactory(java.util.List<java.net.URI> baseList,
java.lang.String bucketName,
java.lang.String password) |
| Modifier and Type | Method and Description |
|---|---|
MemcachedConnection |
createConnection(java.util.List<java.net.InetSocketAddress> addrs)
Create a MemcachedConnection for the given SocketAddresses.
|
NodeLocator |
createLocator(java.util.List<MemcachedNode> nodes)
Create a NodeLocator instance for the given list of nodes.
|
ViewConnection |
createViewConnection(java.util.List<java.net.InetSocketAddress> addrs) |
ViewNode |
createViewNode(java.net.InetSocketAddress addr,
AsyncConnectionManager connMgr) |
AuthDescriptor |
getAuthDescriptor()
Authenticate connections using the given auth descriptor.
|
java.lang.String |
getBucketName() |
ClusterManager |
getClusterManager()
Returns a ClusterManager and initializes one if it does not exist.
|
ConfigurationProvider |
getConfigurationProvider() |
Config |
getVBucketConfig() |
int |
getViewTimeout() |
protected boolean |
pastReconnThreshold()
Checks if there have been more requests than allowed through
maxConfigCheck in a 10 second period.
|
protected void |
requestConfigReconnect(java.lang.String bucketName,
Reconfigurable rec) |
boolean |
shouldOptimize()
If true, low-level optimization is in effect.
|
createMemcachedNode, getName, getOperationFactorycreateOperationQueue, createReadOperationQueue, createWriteOperationQueue, getDefaultTranscoder, getFailureMode, getHashAlg, getInitialObservers, getMaxReconnectDelay, getOperationTimeout, getOpQueueLen, getOpQueueMaxBlockTime, getReadBufSize, getTimeoutExceptionThreshold, isDaemon, toString, useNagleAlgorithmpublic static final FailureMode DEFAULT_FAILURE_MODE
public static final HashAlgorithm DEFAULT_HASH
public static final int DEFAULT_OP_QUEUE_LEN
public static final long DEFAULT_MIN_RECONNECT_INTERVAL
public static final int DEFAULT_VIEW_TIMEOUT
public static final long DEFAULT_OBS_POLL_INTERVAL
public static final int DEFAULT_OBS_POLL_MAX
protected volatile ConfigurationProvider configurationProvider
public CouchbaseConnectionFactory(java.util.List<java.net.URI> baseList,
java.lang.String bucketName,
java.lang.String password)
throws java.io.IOException
java.io.IOExceptionpublic ViewNode createViewNode(java.net.InetSocketAddress addr, AsyncConnectionManager connMgr)
public MemcachedConnection createConnection(java.util.List<java.net.InetSocketAddress> addrs) throws java.io.IOException
ConnectionFactorycreateConnection in interface ConnectionFactorycreateConnection in class DefaultConnectionFactoryaddrs - the addresses of the memcached serversjava.io.IOException - for problems initializing the memcached connectionspublic ViewConnection createViewConnection(java.util.List<java.net.InetSocketAddress> addrs) throws java.io.IOException
java.io.IOExceptionpublic NodeLocator createLocator(java.util.List<MemcachedNode> nodes)
ConnectionFactorycreateLocator in interface ConnectionFactorycreateLocator in class DefaultConnectionFactorypublic boolean shouldOptimize()
ConnectionFactoryshouldOptimize in interface ConnectionFactoryshouldOptimize in class DefaultConnectionFactorypublic AuthDescriptor getAuthDescriptor()
ConnectionFactorygetAuthDescriptor in interface ConnectionFactorygetAuthDescriptor in class DefaultConnectionFactorypublic java.lang.String getBucketName()
public int getViewTimeout()
public Config getVBucketConfig()
public ConfigurationProvider getConfigurationProvider()
protected void requestConfigReconnect(java.lang.String bucketName,
Reconfigurable rec)
protected boolean pastReconnThreshold()
public ClusterManager getClusterManager()
Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.