public class CouchbaseConnectionFactory
extends net.spy.memcached.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 long |
DEFAULT_AUTH_WAIT_TIME
Default auth wait time.
|
static net.spy.memcached.FailureMode |
DEFAULT_FAILURE_MODE
Default failure mode.
|
static net.spy.memcached.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
Deprecated.
|
static long |
DEFAULT_OBS_TIMEOUT
Default Timeout when persistence/replication constraints are used (in ms).
|
static int |
DEFAULT_OP_QUEUE_LEN
Maximum length of the operation queue returned by this connection factory.
|
static CouchbaseNodeOrder |
DEFAULT_STREAMING_NODE_ORDER
Default Node ordering to use for streaming connection.
|
static int |
DEFAULT_VIEW_CONNS_PER_NODE
Default amount of max connections per node.
|
static int |
DEFAULT_VIEW_TIMEOUT
Default View request timeout in ms.
|
static int |
DEFAULT_VIEW_WORKER_SIZE
Default size of view io worker threads.
|
| Constructor and Description |
|---|
CouchbaseConnectionFactory()
Create a new
CouchbaseConnectionFactory and load the required
connection information from system properties. |
CouchbaseConnectionFactory(java.util.List<java.net.URI> baseList,
java.lang.String bucketName,
java.lang.String password) |
| Modifier and Type | Method and Description |
|---|---|
net.spy.memcached.MemcachedConnection |
createConnection(java.util.List<java.net.InetSocketAddress> addrs) |
net.spy.memcached.NodeLocator |
createLocator(java.util.List<net.spy.memcached.MemcachedNode> nodes) |
ViewConnection |
createViewConnection(java.util.List<java.net.InetSocketAddress> addrs) |
net.spy.memcached.auth.AuthDescriptor |
getAuthDescriptor() |
long |
getAuthWaitTime() |
java.lang.String |
getBucketName() |
ClusterManager |
getClusterManager()
Returns a ClusterManager and initializes one if it does not exist.
|
ConfigurationProvider |
getConfigurationProvider() |
long |
getMinReconnectInterval()
The minimum reconnect interval in milliseconds.
|
long |
getObsPollInterval()
The observe poll interval in milliseconds.
|
int |
getObsPollMax()
The number of observe polls to execute before giving up.
|
long |
getObsTimeout()
The observe timeout in milliseconds.
|
CouchbaseNodeOrder |
getStreamingNodeOrder() |
Config |
getVBucketConfig() |
int |
getViewConnsPerNode() |
int |
getViewTimeout() |
int |
getViewWorkerSize() |
protected void |
requestConfigReconnect(java.lang.String bucketName,
Reconfigurable rec) |
boolean |
shouldOptimize() |
java.lang.String |
toString() |
createMemcachedNode, getName, getOperationFactorycreateOperationQueue, createReadOperationQueue, createWriteOperationQueue, enableMetrics, getDefaultTranscoder, getFailureMode, getHashAlg, getInitialObservers, getListenerExecutorService, getMaxReconnectDelay, getMetricCollector, getOperationTimeout, getOpQueueLen, getOpQueueMaxBlockTime, getReadBufSize, getTimeoutExceptionThreshold, isDaemon, isDefaultExecutorService, useNagleAlgorithmpublic static final net.spy.memcached.FailureMode DEFAULT_FAILURE_MODE
public static final net.spy.memcached.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 int DEFAULT_VIEW_WORKER_SIZE
public static final int DEFAULT_VIEW_CONNS_PER_NODE
public static final long DEFAULT_OBS_TIMEOUT
public static final long DEFAULT_OBS_POLL_INTERVAL
@Deprecated public static final int DEFAULT_OBS_POLL_MAX
DEFAULT_OBS_TIMEOUT for correct use. The number of polls is
now calculated automatically based on the DEFAULT_OBS_TIMEOUT and
DEFAULT_OBS_POLL_INTERVAL.public static final long DEFAULT_AUTH_WAIT_TIME
public static final CouchbaseNodeOrder DEFAULT_STREAMING_NODE_ORDER
protected volatile ConfigurationProvider configurationProvider
public CouchbaseConnectionFactory()
CouchbaseConnectionFactory and load the required
connection information from system properties.
The following properties need to be set in order to bootstrap: - cbclient.nodes: ;-separated list of URIs - cbclient.bucket: name of the bucket - cbclient.password: password of the bucket
public CouchbaseConnectionFactory(java.util.List<java.net.URI> baseList,
java.lang.String bucketName,
java.lang.String password)
throws java.io.IOException
java.io.IOExceptionpublic net.spy.memcached.MemcachedConnection createConnection(java.util.List<java.net.InetSocketAddress> addrs)
throws java.io.IOException
createConnection in interface net.spy.memcached.ConnectionFactorycreateConnection in class net.spy.memcached.DefaultConnectionFactoryjava.io.IOExceptionpublic ViewConnection createViewConnection(java.util.List<java.net.InetSocketAddress> addrs) throws java.io.IOException
java.io.IOExceptionpublic net.spy.memcached.NodeLocator createLocator(java.util.List<net.spy.memcached.MemcachedNode> nodes)
createLocator in interface net.spy.memcached.ConnectionFactorycreateLocator in class net.spy.memcached.DefaultConnectionFactorypublic boolean shouldOptimize()
shouldOptimize in interface net.spy.memcached.ConnectionFactoryshouldOptimize in class net.spy.memcached.DefaultConnectionFactorypublic net.spy.memcached.auth.AuthDescriptor getAuthDescriptor()
getAuthDescriptor in interface net.spy.memcached.ConnectionFactorygetAuthDescriptor in class net.spy.memcached.DefaultConnectionFactorypublic java.lang.String getBucketName()
public int getViewTimeout()
public int getViewWorkerSize()
public int getViewConnsPerNode()
public CouchbaseNodeOrder getStreamingNodeOrder()
public Config getVBucketConfig()
public ConfigurationProvider getConfigurationProvider()
protected void requestConfigReconnect(java.lang.String bucketName,
Reconfigurable rec)
public long getMinReconnectInterval()
public long getObsPollInterval()
public long getObsTimeout()
public long getAuthWaitTime()
getAuthWaitTime in interface net.spy.memcached.ConnectionFactorygetAuthWaitTime in class net.spy.memcached.DefaultConnectionFactorypublic int getObsPollMax()
public ClusterManager getClusterManager()
public java.lang.String toString()
toString in class net.spy.memcached.DefaultConnectionFactoryCopyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.