Class CompressedAny2RIDIndex<K>


  • public class CompressedAny2RIDIndex<K>
    extends Object
    Map like optimized to avoid stressing the GC by using mechanical sympathy technique + compression of key and values. This class is synchronized. Values are RIDs, key can be anything. This Map implementation doesn't support to overwrite a value. Values cannot be null.
    A Binary object is used to store the hash table (the first part of it) and then keys and values. The key is serialized in the position pointed by the hash table, then a fixed-size integer containing the next entry (with the same hash) and after that the compressed RID.

    TODO support up to 4GB by using unsigned int

    • Constructor Detail

      • CompressedAny2RIDIndex

        public CompressedAny2RIDIndex​(Database database,
                                      Type keyType,
                                      int expectedSize)
    • Method Detail

      • getKeyBinaryType

        public Type getKeyBinaryType()
      • size

        public int size()
      • isEmpty

        public boolean isEmpty()
      • containsKey

        public boolean containsKey​(Object key)
      • put

        public void put​(K key,
                        RID value)
      • getChunkSize

        public int getChunkSize()
      • getChunkAllocated

        public int getChunkAllocated()
      • getTotalUsedSlots

        public int getTotalUsedSlots()
      • getInternalBuffer

        public Binary getInternalBuffer()