public class HashSlotArray16byteKeyNoValue extends HashSlotArray16byteKeyImpl
key1
field, therefore the chosen null-sentinel value
is not valid as the value of key1
.HashSlotArrayBase.Cursor, HashSlotArrayBase.CursorIntKey2, HashSlotArrayBase.CursorLongKey2
CAPACITY_OFFSET, EXPAND_THRESHOLD_OFFSET, HEADER_SIZE, KEY_1_OFFSET, KEY_2_OFFSET, offsetOfUnassignedSentinel, SIZE_OFFSET, slotLength, unassignedSentinel, VALUE_SIZE_GRANULARITY
Constructor and Description |
---|
HashSlotArray16byteKeyNoValue(long nullKey1,
MemoryManager mm) |
HashSlotArray16byteKeyNoValue(long nullKey1,
MemoryManager mm,
int initialCapacity,
float loadFactor) |
Modifier and Type | Method and Description |
---|---|
SlotAssignmentResult |
ensure(long key1,
long key2)
Ensures that there is a mapping from
(key1, key2) to a slot in the
array. |
long |
get(long key1,
long key2)
Returns the address of the value block mapped by
(key1, key2) . |
boolean |
remove(long key1,
long key2)
Removes the mapping for
(key1, key2) , if any. |
protected boolean |
valueLengthValid(int valueLength) |
addrOfKey1At, addrOfKey2At, addrOfValueAt, cursor, valueAddr2slotBase
address, allocateArrayAndAdjustFields, assertValid, capacity, clear, dispose, ensure0, equal, expansionThreshold, get0, gotoAddress, gotoNew, isAssigned, key1OfSlot, key2OfSlot, keyHash, malloc, markUnassigned, mem, migrateTo, putKey, rehash, remove0, resizeTo, setMemMgr, shiftConflictingKeys, size, slotBase, slotHash, trimToSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
address, capacity, clear, expansionThreshold, gotoAddress, gotoNew, size, trimToSize
dispose
public HashSlotArray16byteKeyNoValue(long nullKey1, MemoryManager mm, int initialCapacity, float loadFactor)
nullKey1
- the null-sentinel value checked against the key1
field.public HashSlotArray16byteKeyNoValue(long nullKey1, MemoryManager mm)
nullKey1
- the null-sentinel value checked against the key1
field.protected boolean valueLengthValid(int valueLength)
valueLengthValid
in class HashSlotArray16byteKeyImpl
public SlotAssignmentResult ensure(long key1, long key2)
HashSlotArray16byteKeyImpl
(key1, key2)
to a slot in the
array.
The returned object contains the slot value block address and whether a new
slot had to be assigned. The hash slot array implementation keeps a reference
to the returned object and will always return the same instance, albeit with
updated fields on each new invocation.
This means the returned object is valid until the next invocation of this
method.
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 HashSlotArray16byteKey
ensure
in class HashSlotArray16byteKeyImpl
key1
- key part 1key2
- key part 2SlotAssignmentResult.isNew()
public long get(long key1, long key2)
HashSlotArray16byteKey
(key1, key2)
.get
in interface HashSlotArray16byteKey
get
in class HashSlotArray16byteKeyImpl
key1
- key part 1key2
- key part 2MemoryAllocator.NULL_ADDRESS
if no mapping for (key1, key2)
exists.public boolean remove(long key1, long key2)
HashSlotArray16byteKey
(key1, key2)
, if any.remove
in interface HashSlotArray16byteKey
remove
in class HashSlotArray16byteKeyImpl
key1
- key part 1key2
- key part 2Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.