Class HashFunctionPartitioner
- java.lang.Object
-
- org.infinispan.distribution.ch.impl.HashFunctionPartitioner
-
- All Implemented Interfaces:
Cloneable
,ToIntFunction<Object>
,org.infinispan.commons.configuration.attributes.Matchable<KeyPartitioner>
,KeyPartitioner
- Direct Known Subclasses:
AffinityPartitioner
public class HashFunctionPartitioner extends Object implements KeyPartitioner, Cloneable
Key partitioner that computes a key's segment based on a hash function.- Since:
- 8.2
- Author:
- Dan Berindei
-
-
Constructor Summary
Constructors Constructor Description HashFunctionPartitioner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
org.infinispan.commons.hash.Hash
getHash()
int
getSegment(Object key)
Obtains the segment for a key.List<Integer>
getSegmentEndHashes()
int
hashCode()
void
init(HashConfiguration configuration)
Initialization.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.distribution.ch.KeyPartitioner
applyAsInt, matches
-
-
-
-
Method Detail
-
init
public void init(HashConfiguration configuration)
Description copied from interface:KeyPartitioner
Initialization.The partitioner can also use injection to access other cache-level or global components. This method will be called before any other injection methods.
Does not need to be thread-safe (Infinispan safely publishes the instance after initialization).
- Specified by:
init
in interfaceKeyPartitioner
-
getSegment
public int getSegment(Object key)
Description copied from interface:KeyPartitioner
Obtains the segment for a key. Must be thread-safe.- Specified by:
getSegment
in interfaceKeyPartitioner
-
getHash
public org.infinispan.commons.hash.Hash getHash()
-
-