ArrayModNodeLocator Class Reference

Inherits net::spy::memcached::NodeLocator.

Collaboration diagram for ArrayModNodeLocator:

Collaboration graph
[legend]

List of all members.

Classes

class  NodeIterator

Public Member Functions

 ArrayModNodeLocator (List< MemcachedNode > n, HashAlgorithm alg)
Collection< MemcachedNodegetAll ()
MemcachedNode getPrimary (String k)
Iterator< MemcachedNodegetSequence (String k)

Package Attributes

final MemcachedNode[] nodes

Private Member Functions

int getServerForKey (String key)

Private Attributes

final HashAlgorithm hashAlg


Detailed Description

NodeLocator implementation for dealing with simple array lookups using a modulus of the hash code and node list length.

Constructor & Destructor Documentation

Construct an ArraymodNodeLocator over the given array of nodes and using the given hash algorithm.

Parameters:
n the array of nodes
alg the hash algorithm


Member Function Documentation

Collection<MemcachedNode> getAll (  ) 

Get all memcached nodes. This is useful for broadcasting messages.

Implements NodeLocator.

MemcachedNode getPrimary ( 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

Implements NodeLocator.

Iterator<MemcachedNode> getSequence ( 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.

Implements NodeLocator.

int getServerForKey ( String  key  )  [private]


Member Data Documentation

final HashAlgorithm hashAlg [private]

final MemcachedNode [] nodes [package]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:37 2012 for Project Wonder by  doxygen 1.5.8