Interface ICache
Represents a cache of expiring objects, which are identified by a key and stored in a pile.
Pile allows to store hundreds of millions of objects without overloading the managed GC.
The cache may be local or distributed
Assembly: Azos.dll
Syntax
public interface ICache : IApplicationComponent
Properties
Count
Returns how many records are kept in cache
Declaration
Property Value
Type |
Description |
System.Int64 |
|
Locality
Returns whether the cache key:value mappings are local or distributed
Declaration
LocalityKind Locality { get; }
Property Value
Persistence
Returns the model of key:value mapping persistence that this cache supports
Declaration
ObjectPersistence Persistence { get; }
Property Value
PileStatus
Returns the status of the pile where object are stored
Declaration
IPileStatus PileStatus { get; }
Property Value
Tables
Tables that this cache contains
Declaration
IRegistry<ICacheTable> Tables { get; }
Property Value
Methods
GetOrCreateTable<TKey>(String, out Boolean, IEqualityComparer<TKey>)
Returns existing table by name, if it does not exist creates a new table.
For existing table the types must be identical to the ones used at creation
Declaration
ICacheTable<TKey> GetOrCreateTable<TKey>(string tableName, out bool createdNew, IEqualityComparer<TKey> keyComparer = null)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.Boolean |
createdNew |
|
System.Collections.Generic.IEqualityComparer<TKey> |
keyComparer |
|
Returns
Type Parameters
GetOrCreateTable<TKey>(String, IEqualityComparer<TKey>)
Returns existing table by name, if it does not exist creates a new table.
For existing table the types must be identical to the ones used at creation
Declaration
ICacheTable<TKey> GetOrCreateTable<TKey>(string tableName, IEqualityComparer<TKey> keyComparer = null)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.Collections.Generic.IEqualityComparer<TKey> |
keyComparer |
|
Returns
Type Parameters
GetTable<TKey>(String)
Returns existing table by name, if it does not exist thorws.
The TKey must correspond to existing table
Declaration
ICacheTable<TKey> GetTable<TKey>(string tableName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
Returns
Type Parameters
PurgeAll()
Removes all data from all tables stored in the cache
Declaration
Extension Methods