net.spy.memcached
Class MembaseConnectionFactory

java.lang.Object
  extended by net.spy.memcached.compat.SpyObject
      extended by net.spy.memcached.DefaultConnectionFactory
          extended by net.spy.memcached.BinaryConnectionFactory
              extended by net.spy.memcached.MembaseConnectionFactory
All Implemented Interfaces:
ConnectionFactory
Direct Known Subclasses:
CouchbaseConnectionFactory

public class MembaseConnectionFactory
extends BinaryConnectionFactory

Membase implementation of ConnectionFactory.

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.


Field Summary
static FailureMode DEFAULT_FAILURE_MODE
          Default failure mode.
static HashAlgorithm DEFAULT_HASH
          Default hash algorithm.
static int DEFAULT_OP_QUEUE_LEN
          Maximum length of the operation queue returned by this connection factory.
 
Fields inherited from class net.spy.memcached.DefaultConnectionFactory
DEFAULT_MAX_RECONNECT_DELAY, DEFAULT_MAX_TIMEOUTEXCEPTION_THRESHOLD, DEFAULT_OP_QUEUE_MAX_BLOCK_TIME, DEFAULT_OPERATION_TIMEOUT, DEFAULT_READ_BUFFER_SIZE, opQueueLen
 
Constructor Summary
MembaseConnectionFactory(List<URI> baseList, String bucketName, String usr, String pwd)
           
 
Method Summary
 NodeLocator createLocator(List<MemcachedNode> nodes)
          Create a NodeLocator instance for the given list of nodes.
 AuthDescriptor getAuthDescriptor()
          Authenticate connections using the given auth descriptor.
 String getBucket()
           
 ConfigurationProvider getConfigurationProvider()
           
 ConnectionFactoryBuilder.Locator getLocator()
           
 Config getVBucketConfig()
           
 
Methods inherited from class net.spy.memcached.BinaryConnectionFactory
createMemcachedNode, getOperationFactory
 
Methods inherited from class net.spy.memcached.DefaultConnectionFactory
createConnection, createOperationQueue, createReadOperationQueue, createWriteOperationQueue, getDefaultTranscoder, getFailureMode, getHashAlg, getInitialObservers, getMaxReconnectDelay, getOperationTimeout, getOpQueueLen, getOpQueueMaxBlockTime, getReadBufSize, getTimeoutExceptionThreshold, isDaemon, shouldOptimize, useNagleAlgorithm
 
Methods inherited from class net.spy.memcached.compat.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FAILURE_MODE

public static final FailureMode DEFAULT_FAILURE_MODE
Default failure mode.


DEFAULT_HASH

public static final HashAlgorithm DEFAULT_HASH
Default hash algorithm.


DEFAULT_OP_QUEUE_LEN

public static final int DEFAULT_OP_QUEUE_LEN
Maximum length of the operation queue returned by this connection factory.

See Also:
Constant Field Values
Constructor Detail

MembaseConnectionFactory

public MembaseConnectionFactory(List<URI> baseList,
                                String bucketName,
                                String usr,
                                String pwd)
                         throws IOException
Throws:
IOException
Method Detail

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

getAuthDescriptor

public AuthDescriptor getAuthDescriptor()
Description copied from interface: ConnectionFactory
Authenticate connections using the given auth descriptor.

Specified by:
getAuthDescriptor in interface ConnectionFactory
Overrides:
getAuthDescriptor in class DefaultConnectionFactory
Returns:
null if no authentication should take place

getVBucketConfig

public Config getVBucketConfig()

getBucket

public String getBucket()

getConfigurationProvider

public ConfigurationProvider getConfigurationProvider()

getLocator

public ConnectionFactoryBuilder.Locator getLocator()