public final class BytesBytesMultiHashMap extends Object
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.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
BytesBytesMultiHashMap(int initialCapacity,
float loadFactor,
int wbSize,
long memUsage) |
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 |
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)
Finds a key.
|
long |
memorySize()
Number of bytes used by the hashmap
There are two main components that take most memory: writeBuffers and refs
Others include instance fields: 100
|
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 memUsage)
public void put(BytesBytesMultiHashMap.KvSource kv, int keyHashCode) throws SerDeException
SerDeException
public byte getValueResult(byte[] key, int offset, int length, BytesBytesMultiHashMap.Result hashMapResult)
key
- Key buffer.offset
- the offset to the key in the bufferhashMapResult
- The object to fill in that can read the values.public void populateValue(WriteBuffers.ByteSegmentRef valueRef)
#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.public int size()
public int getNumValues()
public long memorySize()
public void seal()
public void clear()
public void expandAndRehashToTarget(int estimateNewRowCount)
public void debugDumpTable()
public void debugDumpMetrics()
Copyright © 2017 The Apache Software Foundation. All rights reserved.