|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.spy.memcached.ArrayModNodeLocator
public final class ArrayModNodeLocator
NodeLocator implementation for dealing with simple array lookups using a modulus of the hash code and node list length.
Constructor Summary | |
---|---|
ArrayModNodeLocator(List<MemcachedNode> n,
HashAlgorithm alg)
Construct an ArraymodNodeLocator over the given array of nodes and using the given hash algorithm. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayModNodeLocator(List<MemcachedNode> n, HashAlgorithm alg)
n
- the array of nodesalg
- the hash algorithmMethod Detail |
---|
public Collection<MemcachedNode> getAll()
NodeLocator
getAll
in interface NodeLocator
public MemcachedNode getPrimary(String k)
NodeLocator
getPrimary
in interface NodeLocator
k
- the object key
public Iterator<MemcachedNode> getSequence(String k)
NodeLocator
getSequence
in interface NodeLocator
k
- the object key
public NodeLocator getReadonlyCopy()
NodeLocator
getReadonlyCopy
in interface NodeLocator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |