Namespace Azos.Data.Access.Cache
Classes
Bucketed
Abstraction of an item that can be placed in hashing bucket
CacheRec
Stores cached item (such as a business object) along with additional caching information about it. The instance of this class gets reused for the same Key, so Key is immutable field. The instance of this class is returned by table.Get(key...) so the calling thread may see different Value property with time as it may be dynamically changed by some other thread (the newer value for the same Key)
CacheStore
Represents an efficient in-memory cache of expiring optionally-prioritized objects. This class is highly optimized for caching of business objects in data store implementations and does not guarantee that all hash collisions are handled, that is - some data may be overridden. The implementation relies on 2 stage hashing, where the second collision replaces the existing item with the colliding one if items are equal in their priorities. The degree of collisions is controlled by 'bucketSize' and 'recPerPage' parameters that are passed to the store per table, so basically the tables are capped at a certain size and can not change (bucketSize*recPerPage). The lookup implementation is 100% lock-free, whereas the degree of mutability-related locking is controlled by 'lockCount' per table. This class is thread safe for reading and writing cache items, however it does not guarantee instant read/write consistency between threads.
ComplexKeyHashingStrategy
Provides hashing strategy for keys that are not scalar uint64. This is a companion class for CacheStore which only understands uint64 as keys for efficiency purposes. One may extend this class to implement custom resolution of complex keys into uint64 hashes and provide collision handling. The base implementation uses object.GetHashCode() with chaining for collision resolution
Table
Represents a table that stores cached items identified by keys
TableOptions
Provides config options for cache tables
Enums
TableCapacity
Provides cache table capacity classifications