Class HashFunctionPartitioner
java.lang.Object
org.infinispan.distribution.ch.impl.HashFunctionPartitioner
- All Implemented Interfaces:
Cloneable,ToIntFunction<Object>,Matchable<KeyPartitioner>,KeyPartitioner
- Direct Known Subclasses:
AffinityPartitioner
Key partitioner that computes a key's segment based on a hash function.
- Since:
- 8.2
- Author:
- Dan Berindei
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetHash()intgetSegment(Object key) Obtains the segment for a key.inthashCode()voidinit(HashConfiguration configuration) Initialization.voidinit(KeyPartitioner other) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.infinispan.distribution.ch.KeyPartitioner
applyAsInt, matches
-
Constructor Details
-
HashFunctionPartitioner
public HashFunctionPartitioner() -
HashFunctionPartitioner
public HashFunctionPartitioner(int numSegments)
-
-
Method Details
-
init
Description copied from interface:KeyPartitionerInitialization.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:
initin interfaceKeyPartitioner
-
init
- Specified by:
initin interfaceKeyPartitioner
-
getSegment
Description copied from interface:KeyPartitionerObtains the segment for a key. Must be thread-safe.- Specified by:
getSegmentin interfaceKeyPartitioner
-
getHash
-
getSegmentEndHashes
-
equals
-
hashCode
public int hashCode() -
toString
-