Package com.carrotsearch.hppc
Class RandomizedHashOrderMixer
- java.lang.Object
-
- com.carrotsearch.hppc.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 Summary
Fields Modifier and Type Field Description static RandomizedHashOrderMixer
INSTANCE
protected java.util.concurrent.atomic.AtomicLong
seedMixer
-
Constructor Summary
Constructors Constructor Description RandomizedHashOrderMixer()
RandomizedHashOrderMixer(long seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HashOrderMixingStrategy
clone()
int
newKeyMixer(int newContainerBufferSize)
A new key mixer value.
-
-
-
Field Detail
-
INSTANCE
public static final RandomizedHashOrderMixer INSTANCE
-
seedMixer
protected final java.util.concurrent.atomic.AtomicLong seedMixer
-
-
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 interfaceHashOrderMixingStrategy
-
clone
public HashOrderMixingStrategy clone()
- Specified by:
clone
in interfaceHashOrderMixingStrategy
- Overrides:
clone
in classjava.lang.Object
- Returns:
- Return a clone of this strategy. This should use a different mixing because cloned containers should have a different hash ordering.
-
-