Interface ConnectionFactory

    • Method Detail

      • createConnection

        MemcachedConnection createConnection​(java.util.List<java.net.InetSocketAddress> addrs)
                                      throws java.io.IOException
        Create a MemcachedConnection for the given SocketAddresses.
        Parameters:
        addrs - the addresses of the memcached servers
        Returns:
        a new MemcachedConnection connected to those addresses
        Throws:
        java.io.IOException - for problems initializing the memcached connections
      • createMemcachedNode

        MemcachedNode createMemcachedNode​(java.net.SocketAddress sa,
                                          java.nio.channels.SocketChannel c,
                                          int bufSize)
        Create a new memcached node.
      • createOperationQueue

        java.util.concurrent.BlockingQueue<Operation> createOperationQueue()
        Create a BlockingQueue for operations for a connection.
      • createReadOperationQueue

        java.util.concurrent.BlockingQueue<Operation> createReadOperationQueue()
        Create a BlockingQueue for the operations currently expecting to read responses from memcached.
      • createWriteOperationQueue

        java.util.concurrent.BlockingQueue<Operation> createWriteOperationQueue()
        Create a BlockingQueue for the operations currently expecting to write requests to memcached.
      • getOpQueueMaxBlockTime

        long getOpQueueMaxBlockTime()
        Get the maximum amount of time (in milliseconds) a client is willing to wait to add a new item to a queue.
      • getListenerExecutorService

        java.util.concurrent.ExecutorService getListenerExecutorService()
        Get the ExecutorService which is used to asynchronously execute listeners on futures.
      • isDefaultExecutorService

        boolean isDefaultExecutorService()
        Returns true if the default provided ExecutorService has not been overriden through the builder.
      • createLocator

        NodeLocator createLocator​(java.util.List<MemcachedNode> nodes)
        Create a NodeLocator instance for the given list of nodes.
      • getOperationFactory

        OperationFactory getOperationFactory()
        Get the operation factory for connections built by this connection factory.
      • getOperationTimeout

        long getOperationTimeout()
        Get the operation timeout used by this connection.
      • isDaemon

        boolean isDaemon()
        If true, the IO thread should be a daemon thread.
      • useNagleAlgorithm

        boolean useNagleAlgorithm()
        If true, the nagle algorithm will be used on connected sockets.

        See Socket.setTcpNoDelay(boolean) for more information.

      • getInitialObservers

        java.util.Collection<ConnectionObserver> getInitialObservers()
        Observers that should be established at the time of connection instantiation. These observers will see the first connection established.
      • getFailureMode

        FailureMode getFailureMode()
        Get the default failure mode for the underlying connection.
      • getDefaultTranscoder

        Transcoder<java.lang.Object> getDefaultTranscoder()
        Get the default transcoder to be used in connections created by this factory.
      • shouldOptimize

        boolean shouldOptimize()
        If true, low-level optimization is in effect.
      • getReadBufSize

        int getReadBufSize()
      • getHashAlg

        HashAlgorithm getHashAlg()
        Get the hash algorithm to be used.
      • getMaxReconnectDelay

        long getMaxReconnectDelay()
        Maximum number of milliseconds to wait between reconnect attempts.
      • getAuthDescriptor

        AuthDescriptor getAuthDescriptor()
        Authenticate connections using the given auth descriptor.
        Returns:
        null if no authentication should take place
      • getTimeoutExceptionThreshold

        int getTimeoutExceptionThreshold()
        Maximum number of timeout exception for shutdown connection.
      • enableMetrics

        MetricType enableMetrics()
        If true, metric collections are enabled.
      • getAuthWaitTime

        long getAuthWaitTime()
        The time to wait until authentication completes when an operation is inserted.
        Returns:
        the time in milliseconds.