org.infinispan.distribution
Class AbstractConsistentHash

java.lang.Object
  extended by org.infinispan.distribution.AbstractConsistentHash
All Implemented Interfaces:
ConsistentHash
Direct Known Subclasses:
DefaultConsistentHash, ExperimentalDefaultConsistentHash, UnionConsistentHash

public abstract class AbstractConsistentHash
extends Object
implements ConsistentHash

// TODO: Manik: Document this

Since:
4.0
Author:
Manik Surtani

Constructor Summary
AbstractConsistentHash()
           
 
Method Summary
 boolean isKeyLocalToAddress(Address a, Object key, int replCount)
          Test to see whether a key is mapped to a given address.
 Map<Object,List<Address>> locateAll(Collection<Object> keys, int replCount)
          The logical equivalent of calling ConsistentHash.locate(Object, int) multiple times for each key in the collection of keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.infinispan.distribution.ConsistentHash
getCaches, getDistance, isAdjacent, locate, setCaches
 

Constructor Detail

AbstractConsistentHash

public AbstractConsistentHash()
Method Detail

locateAll

public Map<Object,List<Address>> locateAll(Collection<Object> keys,
                                           int replCount)
Description copied from interface: ConsistentHash
The logical equivalent of calling ConsistentHash.locate(Object, int) multiple times for each key in the collection of keys. Implementations may be optimised for such a bulk lookup, or may just repeatedly call ConsistentHash.locate(Object, int).

Specified by:
locateAll in interface ConsistentHash
Parameters:
keys - keys to locate
replCount - replication count (number of copies) for each key
Returns:
Map of locations, keyed on key.

isKeyLocalToAddress

public boolean isKeyLocalToAddress(Address a,
                                   Object key,
                                   int replCount)
Description copied from interface: ConsistentHash
Test to see whether a key is mapped to a given address.

Specified by:
isKeyLocalToAddress in interface ConsistentHash
Parameters:
a - address to test
key - key to test
replCount - repl count
Returns:
true if the key is mapped to the address; false otherwise

Google Analytics

Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.