Package com.carrotsearch.hppc
Class RandomizedHashOrderMixer
java.lang.Object
com.carrotsearch.hppc.RandomizedHashOrderMixer
- All Implemented Interfaces:
HashOrderMixingStrategy
,Cloneable
Randomized hash order. Does not guarantee deterministic hash ordering between
runs. In fact, it tries hard to avoid such guarantee.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RandomizedHashOrderMixer
protected final AtomicLong
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
int
newKeyMixer
(int newContainerBufferSize) A new key mixer value.
-
Field Details
-
INSTANCE
-
seedMixer
-
-
Constructor Details
-
RandomizedHashOrderMixer
public RandomizedHashOrderMixer() -
RandomizedHashOrderMixer
public RandomizedHashOrderMixer(long seed)
-
-
Method Details
-
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
- Specified by:
clone
in interfaceHashOrderMixingStrategy
- Overrides:
clone
in classObject
- Returns:
- Return a clone of this strategy. This should use a different mixing because cloned containers should have a different hash ordering.
-