Class RecordToIDMap.WriteAccessor

  • Enclosing class:
    RecordToIDMap

    public abstract static class RecordToIDMap.WriteAccessor
    extends Object
    An accessor for building the map.

    NOTE: From a thread safety standpoint, it is unsafe to have multiple WriteAccessors in different threads that reference a single RecordToIDMap.

    • Method Detail

      • getOrCreateID

        public abstract int getOrCreateID()
        Returns the ID corresponding to the current record, allocating a new ID if not found. If this is an LRU WriteAccessor, this will return a value equal to -(id+1) in the event that there is no more room in the cache, where id is the id of the LRU item.
        Returns:
        the ID corresponding to the current record or a new id if not found.
      • commit

        public abstract void commit()
        Commits the current value to the location returned by getOrCreateID in the event of a cache flush. Has no effect if this is not an LRU cache.