Interface KeyPartitioner

All Superinterfaces:
Matchable<KeyPartitioner>, ToIntFunction<Object>
All Known Implementing Classes:
AffinityPartitioner, GroupingPartitioner, HashFunctionPartitioner, SingleSegmentKeyPartitioner

public interface KeyPartitioner extends Matchable<KeyPartitioner>, ToIntFunction<Object>
Map keys to segments.
Since:
8.2
Author:
Dan Berindei
  • Method Details

    • init

      default void init(HashConfiguration configuration)
      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

      default void init(KeyPartitioner other)
    • applyAsInt

      default int applyAsInt(Object value)
      Specified by:
      applyAsInt in interface ToIntFunction<Object>
    • getSegment

      int getSegment(Object key)
      Obtains the segment for a key. Must be thread-safe.
    • matches

      default boolean matches(KeyPartitioner other)
      Specified by:
      matches in interface Matchable<KeyPartitioner>