Class CompressedRID2RIDIndex


  • public class CompressedRID2RIDIndex
    extends Object
    Map like optimized to avoid stressing the GC by using mechanical sympathy technique + compression of key and values. This class is not synchronized. The key is a RID and value is a RIDs. This Map implementation doesn't support the overwrite of a value. Values cannot be null.
    This index is used for invert incoming edge creation.
    A Binary object is used to store the hash table (the first part of it) and then keys and values. The RID key is serialized compressed 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. Another slot is kept to point to the previous entry. The hash table always points to the last element with a linked list in the only direction of the previous.

    TODO support up to 4GB by using unsigned int

    • Field Detail

      • database

        protected final Database database
      • keys

        protected final int keys
      • chunk

        protected Binary chunk
      • totalEntries

        protected int totalEntries
      • totalUsedSlots

        protected int totalUsedSlots
    • Method Detail

      • size

        public int size()
      • setReadOnly

        public void setReadOnly()
      • isEmpty

        public boolean isEmpty()
      • containsKey

        public boolean containsKey​(RID key)
      • get

        public RID get​(RID key)
      • put

        public void put​(RID key,
                        RID valueRID)
      • getKeys

        public int getKeys()
      • getChunkSize

        public int getChunkSize()
      • getChunkAllocated

        public int getChunkAllocated()
      • getTotalUsedSlots

        public int getTotalUsedSlots()