Class RandomizedHashOrderMixer

  • All Implemented Interfaces:
    HashOrderMixingStrategy, java.lang.Cloneable

    public final class RandomizedHashOrderMixer
    extends java.lang.Object
    implements HashOrderMixingStrategy
    Randomized hash order. Does not guarantee deterministic hash ordering between runs. In fact, it tries hard to avoid such guarantee.
    • Field Detail

      • seedMixer

        protected final java.util.concurrent.atomic.AtomicLong seedMixer
    • Constructor Detail

      • RandomizedHashOrderMixer

        public RandomizedHashOrderMixer()
      • RandomizedHashOrderMixer

        public RandomizedHashOrderMixer​(long seed)
    • Method Detail

      • newKeyMixer

        public int newKeyMixer​(int newContainerBufferSize)
        Description copied from interface: HashOrderMixingStrategy
        A new key mixer value. The value can be derived from the new buffer size of the container, but preferably should be random and unique.
        Specified by:
        newKeyMixer in interface HashOrderMixingStrategy
      • clone

        public HashOrderMixingStrategy clone()
        Specified by:
        clone in interface HashOrderMixingStrategy
        Overrides:
        clone in class java.lang.Object
        Returns:
        Return a clone of this strategy. This should use a different mixing because cloned containers should have a different hash ordering.