Class CompactingHashTable<T>

  • Type Parameters:
    T - Record type stored in hash table

    public class CompactingHashTable<T>
    extends AbstractMutableHashTable<T>
    A hash table that uses Flink's managed memory and supports replacement of records or updates to records. For an overview of the general data structure of the hash table, please refer to the description of the 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.