Class LocalCache
Provides default implementation of a cache that stores the mapping locally.
The mapped-to objects may reside in local or distributed pile as configured
Inheritance
System.Object
LocalCache
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.dll
Syntax
public sealed class LocalCache : DaemonWithInstrumentation<IApplicationComponent>, IDisposable, ILocalizedTimeProvider, ICacheImplementation, ICache, IDaemon, IDaemonView, IApplicationComponent, INamed, IConfigurable, IInstrumentable, IExternallyParameterized
Constructors
LocalCache(IApplicationComponent, String)
Declaration
public LocalCache(IApplicationComponent director, string name)
Parameters
LocalCache(IApplicationComponent, String, IPileImplementation)
Declaration
public LocalCache(IApplicationComponent director, string name, IPileImplementation pile)
Parameters
LocalCache(IApplication)
Declaration
public LocalCache(IApplication app)
Parameters
Fields
DEFAULT_TABLE_OPTIONS_SECTION
Declaration
public const string DEFAULT_TABLE_OPTIONS_SECTION = "default-table-options"
Field Value
Type |
Description |
System.String |
|
Properties
ComponentLogTopic
Declaration
public override string ComponentLogTopic { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
Count
Returns total number of records in cache
Declaration
public long Count { get; }
Property Value
Type |
Description |
System.Int64 |
|
DefaultTableOptions
Sets default options for a table which is not found in TableOptions collection.
If this property is null then every table assumes the set of constant values defined in Table class
Declaration
public TableOptions DefaultTableOptions { get; set; }
Property Value
DetailedInstrumentationForAllTables
Handy admin property that sets detailed instrumentation flag for all tables at once
Declaration
[Config]
[ExternalParameter(new string[]{"cache", "pile", "instrumentation"})]
public bool? DetailedInstrumentationForAllTables { get; set; }
Property Value
Type |
Description |
System.Nullable<System.Boolean> |
|
ExternalParameters
Returns named parameters that can be used to control this component
Declaration
public override IEnumerable<KeyValuePair<string, Type>> ExternalParameters { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>> |
|
Overrides
Azos.Apps.DaemonWithInstrumentation<Azos.Apps.IApplicationComponent>.ExternalParameters
InstrumentationEnabled
Implements IInstrumentable
Declaration
[Config(Default = false)]
[ExternalParameter(new string[]{"cache", "pile", "instrumentation"})]
public override bool InstrumentationEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Azos.Apps.DaemonWithInstrumentation<Azos.Apps.IApplicationComponent>.InstrumentationEnabled
Locality
Declaration
public LocalityKind Locality { get; }
Property Value
Persistence
Declaration
public ObjectPersistence Persistence { get; }
Property Value
Pile
Gets/sets a pile instance that this cache is using.
Can set on an inactive only.
If the target pile is directed by this service then it will start/stop the pile,
otherwise the pile has to be managed externally
Declaration
public IPileImplementation Pile { get; set; }
Property Value
PileAllocMode
Declaration
[Config]
[ExternalParameter(new string[]{"cache", "pile", "instrumentation"})]
public AllocationMode PileAllocMode { get; set; }
Property Value
PileMaxMemoryLimit
Declaration
[Config]
[ExternalParameter(new string[]{"cache", "pile", "instrumentation"})]
public long PileMaxMemoryLimit { get; set; }
Property Value
Type |
Description |
System.Int64 |
|
PileStatus
Declaration
public IPileStatus PileStatus { get; }
Property Value
TableOptions
Returns table options - used for table creation
Declaration
public Registry<TableOptions> TableOptions { get; }
Property Value
Tables
Tables that this cache contains
Declaration
public IRegistry<ICacheTable> Tables { get; }
Property Value
Methods
Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Overrides
DoSignalStop()
Declaration
protected override void DoSignalStop()
Overrides
DoStart()
Declaration
protected override void DoStart()
Overrides
DoWaitForCompleteStop()
Declaration
protected override void DoWaitForCompleteStop()
Overrides
ExternalGetParameter(String, out Object, String[])
Gets external parameter value returning true if parameter was found
Declaration
public override bool ExternalGetParameter(string name, out object value, params string[] groups)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Object |
value |
|
System.String[] |
groups |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Azos.Apps.DaemonWithInstrumentation<Azos.Apps.IApplicationComponent>.ExternalGetParameter(System.String, System.Object, System.String[])
ExternalParametersForGroups(String[])
Returns named parameters that can be used to control this component
Declaration
public override IEnumerable<KeyValuePair<string, Type>> ExternalParametersForGroups(params string[] groups)
Parameters
Type |
Name |
Description |
System.String[] |
groups |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>> |
|
Overrides
Azos.Apps.DaemonWithInstrumentation<Azos.Apps.IApplicationComponent>.ExternalParametersForGroups(System.String[])
ExternalSetParameter(String, Object, String[])
Sets external parameter value returning true if parameter was found and set
Declaration
public override bool ExternalSetParameter(string name, object value, params string[] groups)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Object |
value |
|
System.String[] |
groups |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
Azos.Apps.DaemonWithInstrumentation<Azos.Apps.IApplicationComponent>.ExternalSetParameter(System.String, System.Object, System.String[])
GetOrCreateTable<TKey>(String, out Boolean, IEqualityComparer<TKey>)
Declaration
public 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>)
Declaration
public 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)
Declaration
public ICacheTable<TKey> GetTable<TKey>(string tableName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
Returns
Type Parameters
PurgeAll()
Declaration
Implements
System.IDisposable
Extension Methods