CacheMapImpl

sealed
trait CacheMapImpl[T <: Txn[T], K, Store] extends CacheMap[T, K, Store]

A cache map puts an in-memory transaction local cache in front of a persistent store. Entries written during the transaction are held in this cache for fast retrieval. But the cache serves a second purpose: In the confluent system, the write paths are incomplete during the transaction, as it is not known in advance whether a meld forces a new index tree to be generated or not. In this case, the implementation needs to gather this information during the transaction, and when the flush is performed, the new terminal version is appended before writing the cached entries to the persistent store.

Type Params
K

the key type (typically Int for a variable map or Long for an identifier map)

T

the underlying system's transaction type

Companion
object
trait CacheMap[T, K, Store]
trait Cache[T]
class Object
trait Matchable
class Any

Value members

Concrete methods

final override
def cacheContains(key: K, tx: T)(implicit path: Access[LazyRef(...)]): Boolean
Definition Classes
final override
def flushCache(term: Long)(implicit tx: T): Unit

This method should be invoked from the implementations flush hook after it has determined the terminal version at which the entries in the cache are written to the persistent store. If this method is not called, the cache will just vanish and not be written out to the persistent store.

This method should be invoked from the implementations flush hook after it has determined the terminal version at which the entries in the cache are written to the persistent store. If this method is not called, the cache will just vanish and not be written out to the persistent store.

Value Params
term

the new version to append to the paths in the cache (using the PathLike's addTerm method)

tx

the current transaction (should be in commit or right-before commit phase)

Definition Classes
final override
def getCacheOnly[A](key: K, tx: T)(implicit path: Access[T]): Option[A]
Definition Classes
final override
def removeCacheOnly(key: K, tx: T)(implicit path: Access[LazyRef(...)]): Boolean

Removes an entry from the cache, and only the cache. This will not affect any values also persisted to persistent! If the cache does not contain an entry at the given key, this method simply returns.

Removes an entry from the cache, and only the cache. This will not affect any values also persisted to persistent! If the cache does not contain an entry at the given key, this method simply returns.

Value Params
key

key at which the entry is stored

tx

the current transaction

Definition Classes

Inherited methods

def removeCache(key: K, tx: T)(implicit path: Access[LazyRef(...)]): Boolean
Inherited from
CacheMap
def store: Store

The persistent map to which the data is flushed or from which it is retrieved when not residing in cache.

The persistent map to which the data is flushed or from which it is retrieved when not residing in cache.

Inherited from
CacheMap