T - Record type stored in hash tablepublic class CompactingHashTable<T> extends AbstractMutableHashTable<T>
MutableHashTable.
The hash table is internally divided into two parts: The hash index, and the partition buffers that store the actual records. When records are inserted or updated, the hash table appends the records to its corresponding partition, and inserts or updates the entry in the hash index. In the case that the hash table runs out of memory, it compacts a partition by walking through the hash index and copying all reachable elements into a fresh partition. After that, it releases the memory of the partition to compact.
| 限定符和类型 | 类和说明 |
|---|---|
class |
CompactingHashTable.EntryIterator
Iterator that traverses the whole hash table once
If entries are inserted during iteration they may be overlooked by the iterator
|
class |
CompactingHashTable.HashTableProber<PT> |
buildSideComparator, buildSideSerializer, closed, stateLock| 构造器和说明 |
|---|
CompactingHashTable(org.apache.flink.api.common.typeutils.TypeSerializer<T> buildSideSerializer,
org.apache.flink.api.common.typeutils.TypeComparator<T> buildSideComparator,
List<org.apache.flink.core.memory.MemorySegment> memorySegments) |
CompactingHashTable(org.apache.flink.api.common.typeutils.TypeSerializer<T> buildSideSerializer,
org.apache.flink.api.common.typeutils.TypeComparator<T> buildSideComparator,
List<org.apache.flink.core.memory.MemorySegment> memorySegments,
int avgRecordLen) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
abort() |
void |
buildTableWithUniqueKey(org.apache.flink.util.MutableObjectIterator<T> input) |
void |
close()
Closes the hash table.
|
org.apache.flink.util.MutableObjectIterator<T> |
getEntryIterator() |
List<org.apache.flink.core.memory.MemorySegment> |
getFreeMemory() |
<PT> CompactingHashTable.HashTableProber<PT> |
getProber(org.apache.flink.api.common.typeutils.TypeComparator<PT> probeSideComparator,
org.apache.flink.api.common.typeutils.TypePairComparator<PT,T> pairComparator) |
void |
insert(T record) |
void |
insertOrReplaceRecord(T record)
Replaces record in hash table if record already present or append record if not.
|
void |
open()
Initialize the hash table
|
getBuildSideComparator, getBuildSideSerializerpublic CompactingHashTable(org.apache.flink.api.common.typeutils.TypeSerializer<T> buildSideSerializer, org.apache.flink.api.common.typeutils.TypeComparator<T> buildSideComparator, List<org.apache.flink.core.memory.MemorySegment> memorySegments)
public void open()
open 在类中 AbstractMutableHashTable<T>public void close()
close 在类中 AbstractMutableHashTable<T>public void abort()
abort 在类中 AbstractMutableHashTable<T>public List<org.apache.flink.core.memory.MemorySegment> getFreeMemory()
getFreeMemory 在类中 AbstractMutableHashTable<T>public void buildTableWithUniqueKey(org.apache.flink.util.MutableObjectIterator<T> input) throws IOException
IOExceptionpublic final void insert(T record) throws IOException
insert 在类中 AbstractMutableHashTable<T>IOExceptionpublic void insertOrReplaceRecord(T record) throws IOException
insertOrReplaceRecord 在类中 AbstractMutableHashTable<T>record - record to insert or replaceIOExceptionpublic <PT> CompactingHashTable.HashTableProber<PT> getProber(org.apache.flink.api.common.typeutils.TypeComparator<PT> probeSideComparator, org.apache.flink.api.common.typeutils.TypePairComparator<PT,T> pairComparator)
getProber 在类中 AbstractMutableHashTable<T>public org.apache.flink.util.MutableObjectIterator<T> getEntryIterator()
getEntryIterator 在类中 AbstractMutableHashTable<T>CompactingHashTable.EntryIteratorCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.