Class KetamaNodeKeyFormatter

java.lang.Object
net.spy.memcached.KetamaNodeKeyFormatter

public class KetamaNodeKeyFormatter extends Object
Known key formats used in Ketama for assigning nodes around the ring
  • Field Details

  • Constructor Details

    • KetamaNodeKeyFormatter

      public KetamaNodeKeyFormatter()
    • KetamaNodeKeyFormatter

      public KetamaNodeKeyFormatter(KetamaNodeKeyFormatter.Format format)
  • Method Details

    • getFormat

      public KetamaNodeKeyFormatter.Format getFormat()
    • getKeyForNode

      public String getKeyForNode(MemcachedNode node, int repetition)
      Returns a uniquely identifying key, suitable for hashing by the KetamaNodeLocator algorithm.
      Parameters:
      node - The MemcachedNode to use to form the unique identifier
      repetition - The repetition number for the particular node in question (0 is the first repetition)
      Returns:
      The key that represents the specific repetition of the node