Package org.jgroups.blocks
Class ReplCache.ConsistentHashFunction<K>
java.lang.Object
org.jgroups.blocks.ReplCache.ConsistentHashFunction<K>
- All Implemented Interfaces:
ReplCache.HashFunction<K>
public static class ReplCache.ConsistentHashFunction<K>
extends Object
implements ReplCache.HashFunction<K>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFunction that, given a key and a replication count, returns replication_count number of different addresses of nodes.voidinstallNodes(List<Address> new_nodes) When the topology changes, this method will be called.
-
Field Details
-
nodes
-
HASH_SPACE
private static final int HASH_SPACE- See Also:
-
FACTOR
private static final int FACTOR- See Also:
-
-
Constructor Details
-
ConsistentHashFunction
public ConsistentHashFunction()
-
-
Method Details
-
hash
Description copied from interface:ReplCache.HashFunctionFunction that, given a key and a replication count, returns replication_count number of different addresses of nodes.- Specified by:
hashin interfaceReplCache.HashFunction<K>- Parameters:
key-replication_count-- Returns:
-
installNodes
Description copied from interface:ReplCache.HashFunctionWhen the topology changes, this method will be called. Implementations will typically cache the node list- Specified by:
installNodesin interfaceReplCache.HashFunction<K>- Parameters:
new_nodes-
-