Interface PartitioningStrategy<T>

Type Parameters:
T - the object type
All Known Subinterfaces:
GenericPartitioningStrategy
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PartitioningStrategy<T>
A function which determines the position of an object within a Bucket.

Functions will not necessarily return consistent results for subsequent calls using the same parameters, as their behaviour usually depends heavily on current bucket state.

  • Method Summary

    Modifier and Type
    Method
    Description
    int
    allocate(T object, Bucket<T> bucket)
    Calculates the index of the partition to use for the object.
  • Method Details

    • allocate

      int allocate(T object, Bucket<T> bucket)
      Calculates the index of the partition to use for the object.

      The index must be within range of the buckets size.

      Parameters:
      object - the object
      bucket - the bucket
      Returns:
      the index