Add a new string to the map for dictionaries.
Add a new string to the map for dictionaries. The key field has the index of the value i.e. (n - 1) for nth distinct string added to the map, with the offset into the value. The string itself is stored back to back in the value portion with its size at the start being variable length. This exactly matches the end format of the dictionary encoding that stores the dictionary string back-to-back in index order and expected by DictionaryDecoders. So the encoder can use the final value serialized array as is for putting into the encoded column batch (followed by the dictionary indexes of actual values themselves).
The encoded values are read in the initialization of DictionaryDecoder and put into an array, and looked up by its readUTF8String method.
Double the table's size and re-hash everything.
Double the table's size and re-hash everything.
Insert raw bytes with given hash code into the map if not present.
Insert raw bytes with given hash code into the map if not present. The key bytes for comparison is assumed to be at the start having "numKeyBytes" size, while the total size including value is "numBytes". Normally one would have serialized form of key bytes followed by self-contained serialized form of value bytes (i.e. including its size).
This method will handle writing only the 8 byte key header while any additional fixed-width bytes to be tracked in read/write should be taken care of in handleExisting and handleNew. These bytes are not part of key equality check itself.
the base object for the bytes as required by Unsafe API
the base offset for the bytes as required by Unsafe API
number of bytes used by the key which should be at the start of "baseObject" with value after that
the total number of bytes used by key and value together (excluding the four bytes of "numKeyBytes" itself)
the hash code of key bytes
An extension of ByteBufferHashMap to store string keys. The dictionary index is stored as part of key bytes while the variable length string value is stored in the value bytes.