public class HashSlotArray8byteKeyImpl extends HashSlotArrayBase implements HashSlotArray8byteKey
HashSlotArray8byteKey as a restriction of HashSlotArrayBase
to a case where just key1 is used.
This class uses the first 8 bytes of the value block for the unassigned sentinel.
It is the responsibility of the caller to ensure that the unassigned sentinel
is overwritten with a non-sentinel value as soon as a new slot is assigned (after calling
ensure(long) and getting a positive return value).
For the same reason this class must not be instantiated with zero value length. Use
HashSlotArray8byteKeyNoValue as a zero-length key implementation.
HashSlotArrayBase.Cursor, HashSlotArrayBase.CursorIntKey2, HashSlotArrayBase.CursorLongKey2CAPACITY_OFFSET, EXPAND_THRESHOLD_OFFSET, HEADER_SIZE, KEY_1_OFFSET, KEY_2_OFFSET, offsetOfUnassignedSentinel, SIZE_OFFSET, slotLength, unassignedSentinel, VALUE_SIZE_GRANULARITY| Modifier | Constructor and Description |
|---|---|
protected |
HashSlotArray8byteKeyImpl(long unassignedSentinel,
long offsetOfUnassignedSentinel,
MemoryManager mm,
int valueLength,
int initialCapacity,
float loadFactor) |
|
HashSlotArray8byteKeyImpl(long unassignedSentinel,
MemoryManager mm,
int valueLength) |
|
HashSlotArray8byteKeyImpl(long unassignedSentinel,
MemoryManager mm,
int valueLength,
int initialCapacity,
float loadFactor) |
| Modifier and Type | Method and Description |
|---|---|
HashSlotCursor8byteKey |
cursor()
Returns a cursor over all assigned slots in this array.
|
SlotAssignmentResult |
ensure(long key)
Ensures that there is a mapping from the given key to a slot in the array.
|
long |
get(long key)
Returns the address of the value block mapped by the given key.
|
protected long |
key2OfSlot(long baseAddress,
long slot) |
protected long |
keyHash(long key,
long ignored) |
protected void |
putKey(long baseAddress,
long slot,
long key,
long ignored) |
boolean |
remove(long key)
Removes the mapping for the given key.
|
address, allocateArrayAndAdjustFields, assertValid, capacity, clear, dispose, ensure0, equal, expansionThreshold, get0, gotoAddress, gotoNew, isAssigned, key1OfSlot, malloc, markUnassigned, mem, migrateTo, rehash, remove0, resizeTo, setMemMgr, shiftConflictingKeys, size, slotBase, slotHash, trimToSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddress, capacity, clear, expansionThreshold, gotoAddress, gotoNew, size, trimToSizedisposepublic HashSlotArray8byteKeyImpl(long unassignedSentinel,
MemoryManager mm,
int valueLength,
int initialCapacity,
float loadFactor)
public HashSlotArray8byteKeyImpl(long unassignedSentinel,
MemoryManager mm,
int valueLength)
protected HashSlotArray8byteKeyImpl(long unassignedSentinel,
long offsetOfUnassignedSentinel,
MemoryManager mm,
int valueLength,
int initialCapacity,
float loadFactor)
public SlotAssignmentResult ensure(long key)
Whenever this method returns a newly assigned slot, the caller must ensure that the null-sentinel value at the returned address is overwritten with a non-sentinel value.
ensure in interface HashSlotArray8byteKeykey - the keySlotAssignmentResult.isNew()public long get(long key)
HashSlotArray8byteKeyget in interface HashSlotArray8byteKeykey - the keyMemoryAllocator.NULL_ADDRESS
if no mapping for key exists.public boolean remove(long key)
HashSlotArray8byteKeyremove in interface HashSlotArray8byteKeykey - the keypublic HashSlotCursor8byteKey cursor()
HashSlotArray8byteKeycursor in interface HashSlotArray8byteKeyprotected long key2OfSlot(long baseAddress,
long slot)
key2OfSlot in class HashSlotArrayBaseprotected void putKey(long baseAddress,
long slot,
long key,
long ignored)
putKey in class HashSlotArrayBaseprotected long keyHash(long key,
long ignored)
keyHash in class HashSlotArrayBaseCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.