Package net.spy.memcached
Interface NodeLocator
- All Known Implementing Classes:
ArrayModNodeLocator
,KetamaNodeLocator
public interface NodeLocator
Interface for locating a node by hash value.
-
Method Summary
Modifier and TypeMethodDescriptiongetAll()
Get all memcached nodes.getPrimary
(String k) Get the primary location for the given key.Create a read-only copy of this NodeLocator.Get an iterator over the sequence of nodes that make up the backup locations for a given key.void
updateLocator
(List<MemcachedNode> nodes) Update locator status.
-
Method Details
-
getPrimary
Get the primary location for the given key.- Parameters:
k
- the object key- Returns:
- the QueueAttachment containing the primary storage for a key
-
getSequence
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. -
updateLocator
Update locator status.- Parameters:
nodes
- New locator nodes.
-