= Files = == values.[0-9]+ == Hashtable entity values, the serialized V part of the Hashtable. There can be any number of these files, refered to as partitions in the code. Header: 1024 bytes {{{ int next value postings start offset int capacity }}} Posting data: {{{ int value length in bytes. 0 = null byte[] serialized value }}} == keys == Hashtable key postings list, the serialized K part of the Hashtable. If keys share the same hash code, or if the capacity is not great enough for keys to get a unique posting the the hashtable entities will be added to a list that must be iterated in order to find the correct posting. Header: 1024 bytes {{{ int next available key posting offset int entity count int postings start offset -- will change after rehash int postings end offset -- will change after rehash int capacity long version -- increased by 1 after each change to the database }}} Posting data: {{{ deleted key posting values are all set to -2. int offset position in this file to the next entry with the same hash, -1 = null int key hash int value partition number, -1 = null value int offset position in value partition, -1 = null int key length in bytes, 0 = null // todo remove byte[] serialized key (if not null) }}} == hashtable == The actual key entity hashtable, points at the first position in entities-file for the given hash. The position for any given key is calculated with: hash & (capacity - 1); Header: 1024 bytes {{{ int hash posting start offset -- will change after rehash int capacity }}} Posting data: {{{ byte 0 = no posting. Any other value means there is a posting. int offset position in key postings to first entity with this hash int offset position in key postings to last entity with this hash (used at rehash time) }}}