|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.memcached.compat.SpyObject
net.spy.memcached.vbucket.VBucketNodeLocator
public class VBucketNodeLocator
Implementation of the NodeLocator interface that contains vbucket hashing methods
| Constructor Summary | |
|---|---|
VBucketNodeLocator(List<MemcachedNode> nodes,
Config jsonConfig)
Construct a VBucketNodeLocator over the given JSON configuration string. |
|
| Method Summary | |
|---|---|
Collection<MemcachedNode> |
getAll()
Get all memcached nodes. |
MemcachedNode |
getAlternative(String k,
Collection<MemcachedNode> notMyVbucketNodes)
Method returns the node that is not contained in the specified collection of the failed 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. |
int |
getVBucketIndex(String key)
Returns a vbucket index for the given key |
void |
updateLocator(List<MemcachedNode> nodes,
Config config)
|
| Methods inherited from class net.spy.memcached.compat.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VBucketNodeLocator(List<MemcachedNode> nodes,
Config jsonConfig)
nodes - jsonConfig - | Method Detail |
|---|
public MemcachedNode getPrimary(String k)
getPrimary in interface NodeLocatork - the object key
public Iterator<MemcachedNode> getSequence(String k)
getSequence in interface NodeLocatork - the object key
public Collection<MemcachedNode> getAll()
getAll in interface NodeLocatorpublic NodeLocator getReadonlyCopy()
getReadonlyCopy in interface NodeLocator
public void updateLocator(List<MemcachedNode> nodes,
Config config)
public int getVBucketIndex(String key)
key - the key
public MemcachedNode getAlternative(String k,
Collection<MemcachedNode> notMyVbucketNodes)
k - the keynotMyVbucketNodes - a collection of the nodes are excluded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||