Show / Hide Table of Contents

Class 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)

Inheritance
System.Object
DisposableObject
Bucketed
CacheRec
Implements
System.IDisposable
Inherited Members
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
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)
System.Object.ToString()
Namespace: NFX.DataAccess.Cache
Assembly: NFX.dll
Syntax
public sealed class CacheRec : Bucketed, IDisposable

Fields

Key

Key is immutable because CacheRec is returned by table.Get(key)

Declaration
public readonly ulong Key
Field Value
Type Description
System.UInt64

Metadata

Stores arbitrary information about this item

Declaration
public volatile object Metadata
Field Value
Type Description
System.Object

Properties

AbsoluteExpirationUTC

Returns absolute expiration timestamp for this item or null

Declaration
public DateTime? AbsoluteExpirationUTC { get; }
Property Value
Type Description
System.Nullable<System.DateTime>

AgeSec

Returns an approximate age of the item in seconds - an interval since this item was put into the store for the last time

Declaration
public int AgeSec { get; }
Property Value
Type Description
System.Int32

HitCount

Returns how many times this cache item was hit (resulted in successfull read)

Declaration
public int HitCount { get; }
Property Value
Type Description
System.Int32

MaxAgeSec

Returns positive integer that specifies the maximum lifespan duration for this item expressed in seconds, or zero. Zero is returned when this item does not have specific lifespan defined and will be evicted from cache per lifespan specified on the table level: Table.MaxAgeSec (default)

Declaration
public int MaxAgeSec { get; }
Property Value
Type Description
System.Int32

Priority

Returns an integer value that dictates item priority relative to other items in the same table. Priorities play a role during cache collision as an item with higher priority is not going to be replaced by an item with lower priority

Declaration
public int Priority { get; }
Property Value
Type Description
System.Int32

Value

Returns the value - a reference to cached item such as a business object

Declaration
public object Value { get; }
Property Value
Type Description
System.Object

Methods

Destructor()

Declaration
protected override void Destructor()
Overrides
DisposableObject.Destructor()

ValueAs<T>()

Returns typecasted value

Declaration
public T ValueAs<T>()
Returns
Type Description
T
Type Parameters
Name Description
T

Implements

System.IDisposable

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX