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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<MemcachedNode>
getAll()
Get all memcached nodes.MemcachedNode
getPrimary(java.lang.String k)
Get the primary location for the given key.NodeLocator
getReadonlyCopy()
Create a read-only copy of this NodeLocator.java.util.Iterator<MemcachedNode>
getSequence(java.lang.String k)
Get an iterator over the sequence of nodes that make up the backup locations for a given key.void
updateLocator(java.util.List<MemcachedNode> nodes)
Update locator status.
-
-
-
Method Detail
-
getPrimary
MemcachedNode getPrimary(java.lang.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
java.util.Iterator<MemcachedNode> getSequence(java.lang.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
java.util.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
void updateLocator(java.util.List<MemcachedNode> nodes)
Update locator status.- Parameters:
nodes
- New locator nodes.
-
-