public class BytesHashMap extends Object
BytesHashMap are influenced by Apache Spark BytesToBytesMap.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
BytesHashMap.Entry
BytesHashMap Entry contains key and value field.
|
static class |
BytesHashMap.LookupInfo
Handle returned by
lookup(BinaryRowData) function. |
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
BUCKET_SIZE |
static int |
RECORD_EXTRA_LENGTH |
| 构造器和说明 |
|---|
BytesHashMap(Object owner,
org.apache.flink.runtime.memory.MemoryManager memoryManager,
long memorySize,
org.apache.flink.table.types.logical.LogicalType[] keyTypes,
org.apache.flink.table.types.logical.LogicalType[] valueTypes) |
BytesHashMap(Object owner,
org.apache.flink.runtime.memory.MemoryManager memoryManager,
long memorySize,
org.apache.flink.table.types.logical.LogicalType[] keyTypes,
org.apache.flink.table.types.logical.LogicalType[] valueTypes,
boolean inferBucketMemory) |
| 限定符和类型 | 方法和说明 |
|---|---|
org.apache.flink.table.data.binary.BinaryRowData |
append(BytesHashMap.LookupInfo info,
org.apache.flink.table.data.binary.BinaryRowData 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<org.apache.flink.core.memory.MemorySegment> |
getBucketAreaMemorySegments() |
org.apache.flink.util.MutableObjectIterator<BytesHashMap.Entry> |
getEntryIterator()
Returns a destructive iterator for iterating over the entries of this map.
|
long |
getNumElements() |
long |
getNumSpillFiles() |
ArrayList<org.apache.flink.core.memory.MemorySegment> |
getRecordAreaMemorySegments() |
long |
getSpillInBytes() |
long |
getUsedMemoryInBytes() |
BytesHashMap.LookupInfo |
lookup(org.apache.flink.table.data.binary.BinaryRowData 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, org.apache.flink.runtime.memory.MemoryManager memoryManager, long memorySize, org.apache.flink.table.types.logical.LogicalType[] keyTypes, org.apache.flink.table.types.logical.LogicalType[] valueTypes)
public BytesHashMap(Object owner, org.apache.flink.runtime.memory.MemoryManager memoryManager, long memorySize, org.apache.flink.table.types.logical.LogicalType[] keyTypes, org.apache.flink.table.types.logical.LogicalType[] valueTypes, boolean inferBucketMemory)
public BytesHashMap.LookupInfo lookup(org.apache.flink.table.data.binary.BinaryRowData key)
key - by which looking up the value in the hash map.
Only support the key in the BinaryRowData form who has only one MemorySegment.BytesHashMap.LookupInfopublic org.apache.flink.table.data.binary.BinaryRowData append(BytesHashMap.LookupInfo info, org.apache.flink.table.data.binary.BinaryRowData value) throws IOException
EOFException - if the map can't allocate much more memory.IOExceptionpublic long getNumSpillFiles()
public long getUsedMemoryInBytes()
public long getSpillInBytes()
public long getNumElements()
public org.apache.flink.util.MutableObjectIterator<BytesHashMap.Entry> getEntryIterator()
public ArrayList<org.apache.flink.core.memory.MemorySegment> getRecordAreaMemorySegments()
public List<org.apache.flink.core.memory.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.