Module datarush.library
Class RecordToIDMap.WriteAccessor
java.lang.Object
com.pervasive.datarush.tokens.record.RecordToIDMap.WriteAccessor
- Enclosing class:
- RecordToIDMap
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 Summary
Modifier and TypeMethodDescriptionabstract voidcommit()Commits the current value to the location returned by getOrCreateID in the event of a cache flush.abstract intReturns the ID corresponding to the current record, allocating a new ID if not found.
-
Method Details
-
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, whereidis 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.
-