|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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(java.util.List<MemcachedNode> n,
HashAlgorithm alg)
Construct an ArraymodNodeLocator over the given array of nodes and using the given hash algorithm. |
|
| Method Summary | |
|---|---|
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> newNodes)
Update locator status. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayModNodeLocator(java.util.List<MemcachedNode> n,
HashAlgorithm alg)
n - the array of nodesalg - the hash algorithm| Method Detail |
|---|
public java.util.Collection<MemcachedNode> getAll()
NodeLocator
getAll in interface NodeLocatorpublic MemcachedNode getPrimary(java.lang.String k)
NodeLocator
getPrimary in interface NodeLocatork - the object key
public java.util.Iterator<MemcachedNode> getSequence(java.lang.String k)
NodeLocator
getSequence in interface NodeLocatork - the object key
public NodeLocator getReadonlyCopy()
NodeLocator
getReadonlyCopy in interface NodeLocatorpublic void updateLocator(java.util.List<MemcachedNode> newNodes)
NodeLocator
updateLocator in interface NodeLocatornewNodes - New locator nodes.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||