public final class BytesBytesMultiHashMap extends Object implements MemoryEstimate
| Modifier and Type | Class and Description |
|---|---|
static interface |
BytesBytesMultiHashMap.KvSource
The source of keys and values to put into hashtable; avoids byte copying.
|
static class |
BytesBytesMultiHashMap.Result
The result of looking up a key in the multi-hash map.
|
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
BytesBytesMultiHashMap(int initialCapacity,
float loadFactor,
int wbSize,
long maxProbeSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
debugDumpMetrics() |
void |
debugDumpTable()
Writes the debug dump of the table into logs.
|
void |
expandAndRehashToTarget(int estimateNewRowCount) |
int |
findNextNonMatched(int currentSlotNum,
WriteBuffers.ByteSegmentRef keyRef,
BytesBytesMultiHashMap.Result hashMapResult,
MatchTracker matchTracker)
Finds the next non matched Small Table key and value.
|
long |
getEstimatedMemorySize() |
int |
getNumHashBuckets() |
int |
getNumValues()
Number of values in the hashmap
This is equal to or bigger than number of keys, since some values may share the same key
|
byte |
getValueResult(byte[] key,
int offset,
int length,
BytesBytesMultiHashMap.Result hashMapResult,
MatchTracker matchTracker)
Finds a key.
|
long |
memorySize()
Number of bytes used by the hashmap.
|
void |
populateValue(WriteBuffers.ByteSegmentRef valueRef)
Take the segment reference from getValueRefs(byte[],int,List)
result and makes it self-contained - adds byte array where the value is stored, and
updates the offset from "global" write buffers offset to offset within that array.
|
void |
put(BytesBytesMultiHashMap.KvSource kv,
int keyHashCode) |
void |
seal() |
int |
size()
Number of keys in the hashmap
|
public BytesBytesMultiHashMap(int initialCapacity,
float loadFactor,
int wbSize,
long maxProbeSize)
public void put(BytesBytesMultiHashMap.KvSource kv, int keyHashCode) throws SerDeException
SerDeExceptionpublic byte getValueResult(byte[] key,
int offset,
int length,
BytesBytesMultiHashMap.Result hashMapResult,
MatchTracker matchTracker)
key - Key buffer.offset - the offset to the key in the bufferhashMapResult - The object to fill in that can read the values.matchTracker - Opitional object for tracking key matches.public void populateValue(WriteBuffers.ByteSegmentRef valueRef)
public int findNextNonMatched(int currentSlotNum,
WriteBuffers.ByteSegmentRef keyRef,
BytesBytesMultiHashMap.Result hashMapResult,
MatchTracker matchTracker)
currentSlotNum - Start by specifying -1; the return index from the previous call.keyRef - If the return value is not -1, a reference to the key bytes.hashMapResult - If the return value is not -1, the key's values.matchTracker - The object that tracks matches (non-shared).public int size()
public int getNumValues()
public int getNumHashBuckets()
public long memorySize()
public long getEstimatedMemorySize()
getEstimatedMemorySize in interface MemoryEstimatepublic void seal()
public void clear()
public void expandAndRehashToTarget(int estimateNewRowCount)
public void debugDumpTable()
public void debugDumpMetrics()
Copyright © 2024 The Apache Software Foundation. All rights reserved.