Class AbstractBytesMultiMap<K>

  • Direct Known Subclasses:
    BytesMultiMap, WindowBytesMultiMap

    public abstract class AbstractBytesMultiMap<K>
    extends BytesMap<K,​Iterator<RowData>>
    A binary map in the structure like Map<K, List<V>>, where there are multiple values under a single key, and they are all bytes based. It can be used for performing aggregations where the accumulator of aggregations are unfixed-width. The memory is divided into three areas:

    Bucket area: pointer + hashcode

       |---- 4 Bytes (pointer to key entry) ----|
       |----- 4 Bytes (key hashcode) ----------|
     

    Key area: a key entry contains key data, pointer to the tail value, and the head value entry.

       |--- 4 + len(K) Bytes  (key data) ------|
       |--- 4 Bytes (pointer to tail value) ---|
       |--- 4 Bytes (pointer to next value) ---|
       |--- 4 + len(V) Bytes (value data) -----|
     

    Value area: a value entry contains a pointer to the next value and the value data. Pointer is -1 if this is the last entry.

       |--- 4 Bytes (pointer to next value) ---|
       |--- 4 + len(V) Bytes (value data) -----|