Package org.infinispan.distribution.ch
Interface KeyPartitioner
- All Superinterfaces:
Matchable<KeyPartitioner>,ToIntFunction<Object>
- All Known Implementing Classes:
AffinityPartitioner,GroupingPartitioner,HashFunctionPartitioner,SingleSegmentKeyPartitioner
Map keys to segments.
- Since:
- 8.2
- Author:
- Dan Berindei
-
Method Summary
Modifier and TypeMethodDescriptiondefault intapplyAsInt(Object value) intgetSegment(Object key) Obtains the segment for a key.default voidinit(HashConfiguration configuration) Initialization.default voidinit(KeyPartitioner other) default booleanmatches(KeyPartitioner other)
-
Method Details
-
init
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).
- Parameters:
configuration-
-
init
-
applyAsInt
- Specified by:
applyAsIntin interfaceToIntFunction<Object>
-
getSegment
Obtains the segment for a key. Must be thread-safe. -
matches
- Specified by:
matchesin interfaceMatchable<KeyPartitioner>
-