IDataCacheObject

Description

interface Tinman.Core.Caching.IDataCacheObject

Base interface for source data objects that can be cached by a DataCache object.

Public / Methods

Cache​Evict​Page


public method CacheEvictPage → (2)

cacheIndex in : int32

Index of the cache page that is about to be evicted.

released in : bool

Is the cache page being released via DataCache.Release2 or DataCache.SourceIdRelease (true), or is it the least-recently used, non-locked page is being evicted during a call to DataCache.Access ( false)?

A used cache page is about to be evicted from the cache.

Cache​Read​Page


public method CacheReadPage → (4)

cacheIndex in : int32

Index of the cache page where to store the data.

sourceId in : int32

The source ID of this data cache object.

sourceIndex in : int64

Index of the source page to read from (54-bit).

partially in : int32

0 : Load partial page (overwrite given cache page)
1 : Load full page (overwrite given cache page)
2 : Finish loading of partial page (complete given cache page)

Reads data from this source data object and stores it in the given cache page.

Before this method is called, the DataCache releases the current lock(see IBeginEnd.End). After this method has returned, the lock is reacquired (see IBeginEnd.Begin). Access to the cache page at cacheIndex in is guaranteed to the thread-safe.

IOException

If an I/O error has occurred while loading the cache page.

Cache​Recycle​Page


public method CacheRecyclePage → (2)

cacheIndex in : int32

Index of the cache page that is to be evicted resp. reused.

populatedByMe in : bool

true it the cache page slot has been populated by this data cache object, false if another data cache object has populated it or if it is still empty.

returns → bool

true if the data cache object will recycle and reuse the cache slot value, false if it will create a new one (the cache slot will be cleared before CacheReadPage in that case, via DataCache.ClearPage).

Checks the given cache page can be reused by this source data object.

Iff the cache page can be reused (i.e. the method returns true), the cache page content may be modified by this method.

Cache​Write​Page


public method CacheWritePage → (4)

cacheIndex in : int32

Index of the cache page that holds the data.

sourceId in : int32

The source ID of this data cache object.

sourceIndex in : int64

Index of the source page to write to (54-bit).

partially in : bool

Has the source page been loaded partially only?

A dirty cache page must be written to the source data object.

Before this method is called, the DataCache releases the current lock(see IBeginEnd.End). After this method has returned, the lock is reacquired (see IBeginEnd.Begin). Access to the cache page at cacheIndex in is guaranteed to the thread-safe.

IOException

If an I/O error has occurred while writing the cache page.