public final class ArrayModNodeLocator extends java.lang.Object implements NodeLocator
Constructor and Description |
---|
ArrayModNodeLocator(java.util.List<MemcachedNode> n,
HashAlgorithm alg)
Construct an ArraymodNodeLocator over the given array of nodes and using
the given hash algorithm.
|
Modifier and Type | Method and 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> newNodes)
Update locator status.
|
public ArrayModNodeLocator(java.util.List<MemcachedNode> n, HashAlgorithm alg)
n
- the array of nodesalg
- the hash algorithmpublic java.util.Collection<MemcachedNode> getAll()
NodeLocator
getAll
in interface NodeLocator
public MemcachedNode getPrimary(java.lang.String k)
NodeLocator
getPrimary
in interface NodeLocator
k
- the object keypublic java.util.Iterator<MemcachedNode> getSequence(java.lang.String k)
NodeLocator
getSequence
in interface NodeLocator
k
- the object keypublic NodeLocator getReadonlyCopy()
NodeLocator
getReadonlyCopy
in interface NodeLocator
public void updateLocator(java.util.List<MemcachedNode> newNodes)
NodeLocator
updateLocator
in interface NodeLocator
newNodes
- New locator nodes.Copyright © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.