Package com.carrotsearch.hppc
Class RandomizedHashOrderMixer
- java.lang.Object
-
- com.carrotsearch.hppc.RandomizedHashOrderMixer
-
- All Implemented Interfaces:
HashOrderMixingStrategy,Cloneable
public final class RandomizedHashOrderMixer extends Object implements HashOrderMixingStrategy
Randomized hash order. Does not guarantee deterministic hash ordering between runs. In fact, it tries hard to avoid such guarantee.
-
-
Field Summary
Fields Modifier and Type Field Description static RandomizedHashOrderMixerINSTANCEprotected AtomicLongseedMixer
-
Constructor Summary
Constructors Constructor Description RandomizedHashOrderMixer()RandomizedHashOrderMixer(long seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HashOrderMixingStrategyclone()intnewKeyMixer(int newContainerBufferSize)A new key mixer value.
-
-
-
Field Detail
-
INSTANCE
public static final RandomizedHashOrderMixer INSTANCE
-
seedMixer
protected final AtomicLong seedMixer
-
-
Method Detail
-
newKeyMixer
public int newKeyMixer(int newContainerBufferSize)
Description copied from interface:HashOrderMixingStrategyA 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:
newKeyMixerin interfaceHashOrderMixingStrategy
-
clone
public HashOrderMixingStrategy clone()
- Specified by:
clonein interfaceHashOrderMixingStrategy- Overrides:
clonein classObject- Returns:
- Return a clone of this strategy. This should use a different mixing because cloned containers should have a different hash ordering.
-
-