Interface KeyPartitioner

  • All Superinterfaces:
    Matchable<KeyPartitioner>, java.util.function.ToIntFunction<java.lang.Object>

    public interface KeyPartitioner
    extends Matchable<KeyPartitioner>, java.util.function.ToIntFunction<java.lang.Object>
    Map keys to segments.
    Since:
    8.2
    Author:
    Dan Berindei
    • Method Detail

      • 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 -
      • applyAsInt

        default int applyAsInt​(java.lang.Object value)
        Specified by:
        applyAsInt in interface java.util.function.ToIntFunction<java.lang.Object>
      • getSegment

        int getSegment​(java.lang.Object key)
        Obtains the segment for a key. Must be thread-safe.