Module datarush.library
Class RecordToIDMap.WriteAccessor
- java.lang.Object
-
- com.pervasive.datarush.tokens.record.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 singleRecordToIDMap
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
commit()
Commits the current value to the location returned by getOrCreateID in the event of a cache flush.abstract int
getOrCreateID()
Returns the ID corresponding to the current record, allocating a new ID if not found.
-
-
-
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, whereid
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.
-
-