Class KetamaIterator

java.lang.Object
net.spy.memcached.compat.SpyObject
net.spy.memcached.KetamaIterator
All Implemented Interfaces:
Iterator<MemcachedNode>

class KetamaIterator extends SpyObject implements Iterator<MemcachedNode>
Implements an Iterator which the KetamaNodeLoctaor may return to a client for iterating through alternate nodes for a given key.
  • Field Details

    • key

      private final String key
    • hashVal

      private long hashVal
    • remainingTries

      private int remainingTries
    • numTries

      private int numTries
    • hashAlg

      private final HashAlgorithm hashAlg
    • ketamaNodes

      private final TreeMap<Long,MemcachedNode> ketamaNodes
  • Constructor Details

    • KetamaIterator

      protected KetamaIterator(String k, int t, TreeMap<Long,MemcachedNode> ketamaNodes, HashAlgorithm hashAlg)
      Create a new KetamaIterator to be used by a client for an operation.
      Parameters:
      k - the key to iterate for
      t - the number of tries until giving up
      ketamaNodes - the continuum in the form of a TreeMap to be used when selecting a node
      hashAlg - the hash algorithm to use when selecting within the continuumq
  • Method Details