Class KetamaConnectionFactory

All Implemented Interfaces:
ConnectionFactory

public class KetamaConnectionFactory extends DefaultConnectionFactory
ConnectionFactory instance that sets up a ketama compatible connection.

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.

See Also:
  • Field Details

  • Constructor Details

    • KetamaConnectionFactory

      public KetamaConnectionFactory(int qLen, int bufSize, long opQueueMaxBlockTime)
      Create a KetamaConnectionFactory with the given maximum operation queue length, and the given read buffer size.
      Parameters:
      opQueueMaxBlockTime - the maximum time to block waiting for op queue operations to complete, in milliseconds
    • KetamaConnectionFactory

      public KetamaConnectionFactory(int qLen, int bufSize, long opQueueMaxBlockTime, HashAlgorithm hash, KetamaNodeKeyFormatter.Format nodeKeyFormat, Map<InetSocketAddress,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.
    • KetamaConnectionFactory

      public KetamaConnectionFactory()
      Create a KetamaConnectionFactory with the default parameters.
  • Method Details