net.spy.memcached
Interface NodeLocator

All Known Implementing Classes:
ArrayModNodeLocator, KetamaNodeLocator

public interface NodeLocator

Interface for locating a node by hash value.


Method Summary
 Collection<MemcachedNode> getAll()
          Get all memcached nodes.
 MemcachedNode getPrimary(String k)
          Get the primary location for the given key.
 NodeLocator getReadonlyCopy()
          Create a read-only copy of this NodeLocator.
 Iterator<MemcachedNode> getSequence(String k)
          Get an iterator over the sequence of nodes that make up the backup locations for a given key.
 

Method Detail

getPrimary

MemcachedNode getPrimary(String k)
Get the primary location for the given key.

Parameters:
k - the object key
Returns:
the QueueAttachment containing the primary storage for a key

getSequence

Iterator<MemcachedNode> getSequence(String k)
Get an iterator over the sequence of nodes that make up the backup locations for a given key.

Parameters:
k - the object key
Returns:
the sequence of backup nodes.

getAll

Collection<MemcachedNode> getAll()
Get all memcached nodes. This is useful for broadcasting messages.


getReadonlyCopy

NodeLocator getReadonlyCopy()
Create a read-only copy of this NodeLocator.