public class BytesHashMap extends Object
BytesHashMap
are influenced by Apache Spark BytesToBytesMap.
Modifier and Type | Class and Description |
---|---|
static class |
BytesHashMap.Entry
BytesHashMap Entry contains key and value field.
|
static class |
BytesHashMap.LookupInfo
Handle returned by
lookup(BinaryRow) function. |
Modifier and Type | Field and Description |
---|---|
static int |
BUCKET_SIZE |
static int |
RECORD_EXTRA_LENGTH |
Constructor and Description |
---|
BytesHashMap(Object owner,
MemoryManager memoryManager,
long memorySize,
LogicalType[] keyTypes,
LogicalType[] valueTypes) |
BytesHashMap(Object owner,
MemoryManager memoryManager,
long memorySize,
LogicalType[] keyTypes,
LogicalType[] valueTypes,
boolean inferBucketMemory) |
Modifier and Type | Method and Description |
---|---|
BinaryRow |
append(BytesHashMap.LookupInfo info,
BinaryRow value)
Append an value into the hash map's record area.
|
void |
free()
release the map's record and bucket area's memory segments.
|
void |
free(boolean reservedRecordMemory) |
List<MemorySegment> |
getBucketAreaMemorySegments() |
MutableObjectIterator<BytesHashMap.Entry> |
getEntryIterator()
Returns a destructive iterator for iterating over the entries of this map.
|
long |
getNumElements() |
long |
getNumSpillFiles() |
ArrayList<MemorySegment> |
getRecordAreaMemorySegments() |
long |
getSpillInBytes() |
long |
getUsedMemoryInBytes() |
boolean |
isHashSetMode() |
BytesHashMap.LookupInfo |
lookup(BinaryRow key) |
void |
reset()
reset the map's record and bucket area's memory segments for reusing.
|
public static final int BUCKET_SIZE
public static final int RECORD_EXTRA_LENGTH
public BytesHashMap(Object owner, MemoryManager memoryManager, long memorySize, LogicalType[] keyTypes, LogicalType[] valueTypes)
public BytesHashMap(Object owner, MemoryManager memoryManager, long memorySize, LogicalType[] keyTypes, LogicalType[] valueTypes, boolean inferBucketMemory)
public boolean isHashSetMode()
public BytesHashMap.LookupInfo lookup(BinaryRow key)
key
- by which looking up the value in the hash map.
Only support the key in the BinaryRow form who has only one MemorySegment.BytesHashMap.LookupInfo
public BinaryRow append(BytesHashMap.LookupInfo info, BinaryRow value) throws IOException
EOFException
- if the map can't allocate much more memory.IOException
public long getNumSpillFiles()
public long getUsedMemoryInBytes()
public long getSpillInBytes()
public long getNumElements()
public MutableObjectIterator<BytesHashMap.Entry> getEntryIterator()
public ArrayList<MemorySegment> getRecordAreaMemorySegments()
public List<MemorySegment> getBucketAreaMemorySegments()
public void free()
public void free(boolean reservedRecordMemory)
reservedRecordMemory
- reserved fixed memory or not.public void reset()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.