Show / Hide Table of Contents

Class DefaultPileBase

Provides base for default implementation of IPile which stores objects on a local machine in memory or in the MMF

Inheritance
System.Object
DisposableObject
ApplicationComponent
Service
Service<System.Object>
ServiceWithInstrumentationBase<System.Object>
DefaultPileBase
DefaultPile
MMFPile
Implements
ILocalizedTimeProvider
IPileImplementation
IPile
IPileStatus
System.Collections.Generic.IEnumerable<PileEntry>
System.Collections.IEnumerable
IApplicationComponent
System.IDisposable
IService
INamed
IConfigurable
IInstrumentable
IExternallyParameterized
Inherited Members
ServiceWithInstrumentationBase<Object>.ExternalParameters
ServiceWithInstrumentationBase<Object>.ExternalParametersForGroups(String[])
ServiceWithInstrumentationBase<Object>.ExternalGetParameter(String, Object, String[])
ServiceWithInstrumentationBase<Object>.ExternalSetParameter(String, Object, String[])
Service<Object>.ComponentDirector
Service.CONFIG_NAME_ATTR
Service.ApplicationDontAutoStartService
Service.Status
Service.Running
Service.Name
Service.TimeLocation
Service.LocalizedTime
Service.Configure(IConfigSectionNode)
Service.Start()
Service.SignalStop()
Service.CheckForCompleteStop()
Service.WaitForCompleteStop()
Service.AcceptManagerVisit(Object, DateTime)
Service.UniversalTimeToLocalizedTime(DateTime)
Service.LocalizedTimeToUniversalTime(DateTime)
Service.AbortStart()
Service.DoSignalStop()
Service.DoCheckForCompleteStop()
Service.CheckServiceInactive()
Service.CheckServiceActive()
Service.CheckServiceActiveOrStarting()
Service.____ObtainPrivateServiceStatusLockObject()
ApplicationComponent.AllComponents
ApplicationComponent.GetAppComponentBySID(UInt64)
ApplicationComponent.GetAppComponentByCommonName(String)
ApplicationComponent.ComponentSID
ApplicationComponent.ComponentStartTime
ApplicationComponent.ComponentCommonName
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.ApplicationModel.Pile
Assembly: NFX.dll
Syntax
public abstract class DefaultPileBase : ServiceWithInstrumentationBase<object>, ILocalizedTimeProvider, IPileImplementation, IPile, IPileStatus, IEnumerable<PileEntry>, IEnumerable, IApplicationComponent, IDisposable, IService, INamed, IConfigurable, IInstrumentable, IExternallyParameterized

Constructors

DefaultPileBase(Object, String)

Declaration
protected DefaultPileBase(object director, string name = null)
Parameters
Type Name Description
System.Object director
System.String name

DefaultPileBase(String)

Declaration
protected DefaultPileBase(string name = null)
Parameters
Type Name Description
System.String name

Fields

CONFIG_FREE_CHUNK_SIZES_ATTR

Declaration
public const string CONFIG_FREE_CHUNK_SIZES_ATTR = "free-chunk-sizes"
Field Value
Type Description
System.String

CONFIG_PILE_SECTION

Declaration
public const string CONFIG_PILE_SECTION = "pile"
Field Value
Type Description
System.String

FREE_CHUNK_SIZE_MIN

Declaration
public const int FREE_CHUNK_SIZE_MIN = 64
Field Value
Type Description
System.Int32

FREE_LST_COUNT

Declaration
public const int FREE_LST_COUNT = 16
Field Value
Type Description
System.Int32

FREE_LST_SIZE_MAX

Declaration
public const int FREE_LST_SIZE_MAX = 131072
Field Value
Type Description
System.Int32

FREE_LST_SIZE_MIN

Declaration
public const int FREE_LST_SIZE_MIN = 25600
Field Value
Type Description
System.Int32

m_CurrentTypeRegistry

Declaration
protected volatile TypeRegistry m_CurrentTypeRegistry
Field Value
Type Description
TypeRegistry

m_CurrentTypeRegistryLock

Declaration
protected object m_CurrentTypeRegistryLock
Field Value
Type Description
System.Object

SEG_SIZE_DFLT

Declaration
public const int SEG_SIZE_DFLT = 268435456
Field Value
Type Description
System.Int32

SEG_SIZE_MAX

Declaration
public const int SEG_SIZE_MAX = 2147483376
Field Value
Type Description
System.Int32

SEG_SIZE_MIN

Declaration
public const int SEG_SIZE_MIN = 67108864
Field Value
Type Description
System.Int32

SVER_BUFF

Declaration
public const byte SVER_BUFF = 1
Field Value
Type Description
System.Byte

SVER_LINK

Declaration
public const byte SVER_LINK = 3
Field Value
Type Description
System.Byte

SVER_SLIM

Declaration
public const byte SVER_SLIM = 0
Field Value
Type Description
System.Byte

SVER_UTF8

Declaration
public const byte SVER_UTF8 = 2
Field Value
Type Description
System.Byte

Properties

AllocatedMemoryBytes

Returns the number of bytes allocated by this pile from the system memory heap. As pile pre-allocates memory in segments, it is absolutely normal to have this property return 100s of megabytes even when pile is almost empty. This property may return close to all physical memory available

Declaration
public long AllocatedMemoryBytes { get; }
Property Value
Type Description
System.Int64

AllocMode

Defines modes of allocation: space/time tradeoff

Declaration
[Config]
[ExternalParameter(new string[]{"pile", "instrumentation"})]
public AllocationMode AllocMode { get; set; }
Property Value
Type Description
AllocationMode

FreeChunkSizes

Sets the sizes of free chunks that free lists group by. Must be an array of FREE_LST_COUNT(16) of consequitively increasing integers

Declaration
public int[] FreeChunkSizes { get; set; }
Property Value
Type Description
System.Int32[]

FreeListSize

Determines the size of free chunk list. Every segment has FREE_LST_COUNT=16 lists each of this size. This property may only be set on an inactive service instance

Declaration
[Config]
public int FreeListSize { get; set; }
Property Value
Type Description
System.Int32

Identity

When set to value greater than zero, provides a process-unique identity of the pile instance. The property must be set to unique value in order to start the pile, or set to less or equal to zero to keep the instance private. Used by Piled via PileInstances retrived by Identity (if greater than zero)

Declaration
[Config]
public int Identity { get; set; }
Property Value
Type Description
System.Int32

InstrumentationEnabled

Implements IInstrumentable

Declaration
[Config(Default = false)]
[ExternalParameter(new string[]{"pile", "instrumentation"})]
public override bool InstrumentationEnabled { get; set; }
Property Value
Type Description
System.Boolean
Overrides
NFX.ServiceModel.ServiceWithInstrumentationBase<System.Object>.InstrumentationEnabled

Locality

Returns PileLocality.Local

Declaration
public virtual LocalityKind Locality { get; }
Property Value
Type Description
LocalityKind

MaxMemoryLimit

Imposes a limit on maximum number of bytes that a pile can allocate of the system heap. The default value of 0 means no limit, meaning - the pile will keep allocating objects until the system allows. The value may not be less than minimum 1 seg size (64 mb). May set on an active instance, however no existing objects will be removed if the limit is exceeded

Declaration
[Config]
[ExternalParameter(new string[]{"pile", "instrumentation"})]
public long MaxMemoryLimit { get; set; }
Property Value
Type Description
System.Int64

MaxSegmentLimit

Gets the maximum count of segments tha this pile can have. The property is not thread-safe for set and can only be set if pile is inactive. The value of zero means no limit

Declaration
[Config]
public int MaxSegmentLimit { get; set; }
Property Value
Type Description
System.Int32

MemoryCapacityBytes

Returns an approximate capacity of free memory that the system has left

Declaration
public long MemoryCapacityBytes { get; }
Property Value
Type Description
System.Int64

NodeCount

Returns 1 as this pile is not distributed

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

ObjectCount

Returns the total number of objects allocated at this point in time

Declaration
public long ObjectCount { get; }
Property Value
Type Description
System.Int64

ObjectLinkCount

Returns the total number of object links allocated at this point in time

Declaration
public long ObjectLinkCount { get; }
Property Value
Type Description
System.Int64

OverheadBytes

Returns the number of extra bytes used by pile metadata currently occupied by object stored in this pile

Declaration
public long OverheadBytes { get; }
Property Value
Type Description
System.Int64

Persistence

Returns PilePersistence - where data is kept

Declaration
public abstract ObjectPersistence Persistence { get; }
Property Value
Type Description
ObjectPersistence

SegmentCount

Returns the total number of segments allocated at this point in time

Declaration
public long SegmentCount { get; }
Property Value
Type Description
System.Int64

SegmentSize

Gets the maximum segment size in bytes, up to (2^31)-1 The property is not thread-safe for set and can only be set if pile is inactive

Declaration
[Config]
public int SegmentSize { get; set; }
Property Value
Type Description
System.Int32

SegmentTotalCount

Returns the total number of total segments - allocated and empty at this point in time. This number is greater or equal to SegmentCount

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

SupportsObjectExpiration

Returns false

Declaration
public bool SupportsObjectExpiration { get; }
Property Value
Type Description
System.Boolean

SweepExpiredObjects

Returns false and does nothing on set in this implementation if they are set

Declaration
public bool SweepExpiredObjects { get; set; }
Property Value
Type Description
System.Boolean

UtilizedBytes

Returns the number of bytes currently occupied by object stored in this pile. This number is always less than AllocatedMemoryBytes

Declaration
public long UtilizedBytes { get; }
Property Value
Type Description
System.Int64

Methods

Compact()

Declaration
public long Compact()
Returns
Type Description
System.Int64

Crawl(Boolean)

Analyzes all segments scanning for free spaces. Returns number of uncovered free bytes. This is a full-blocking long operation that may take around 8 seconds on a 64Gb heaps in non-parallel mode

Declaration
public DefaultPileBase.SegmentCrawlStatus Crawl(bool parallel)
Parameters
Type Name Description
System.Boolean parallel
Returns
Type Description
DefaultPileBase.SegmentCrawlStatus

Delete(PilePointer, Boolean)

Deletes object from pile by its pointer returning true if there is no access violation and pointer is pointing to the valid object, throws otherwise unless throwInvalid is set to false

Declaration
public bool Delete(PilePointer ptr, bool throwInvalid = true)
Parameters
Type Name Description
PilePointer ptr
System.Boolean throwInvalid
Returns
Type Description
System.Boolean

delete(PilePointer, Boolean, Boolean)

Declaration
public bool delete(PilePointer ptr, bool throwInvalid, bool isLink)
Parameters
Type Name Description
PilePointer ptr
System.Boolean throwInvalid
System.Boolean isLink
Returns
Type Description
System.Boolean

Destructor()

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

DoAcceptManagerVisit(Object, DateTime)

Declaration
protected override void DoAcceptManagerVisit(object manager, DateTime managerNow)
Parameters
Type Name Description
System.Object manager
System.DateTime managerNow
Overrides
Service.DoAcceptManagerVisit(Object, DateTime)

DoConfigure(IConfigSectionNode)

Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node
Overrides
Service.DoConfigure(IConfigSectionNode)

DoStart()

Declaration
protected override void DoStart()
Overrides
Service.DoStart()

DoWaitForCompleteStop()

Declaration
protected override void DoWaitForCompleteStop()
Overrides
Service.DoWaitForCompleteStop()

Get(PilePointer)

Returns a CLR object by its pointer or throws access violation if pointer is invalid

Declaration
public object Get(PilePointer ptr)
Parameters
Type Name Description
PilePointer ptr
Returns
Type Description
System.Object

GetEnumerator()

Declaration
public IEnumerator<PileEntry> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<PileEntry>

GetRawBuffer(PilePointer, out Byte)

Returns a raw byte[] occupied by the object payload, only payload is returned along with serializer flag which tells what kind of serializer was used. This method is rarely used, it is needed for debugging and special-case "direct" memory access on read to bypass the de-serialization process altogether

Declaration
public byte[] GetRawBuffer(PilePointer ptr, out byte serializerFlag)
Parameters
Type Name Description
PilePointer ptr
System.Byte serializerFlag
Returns
Type Description
System.Byte[]

Purge()

Declaration
public void Purge()

Put(PilePointer, Object, UInt32, Boolean)

Tries to put the new object over an existing one at the pre-define position. The pointer has to reference a valid allocated block. If object fits in the allocated block returns true, otherwise tries to create an internal link to the new pointer which is completely transparent to the caller. The linking may be explicitly disabled in which case the method returns false when the new object does not fit into the existing block

Declaration
public bool Put(PilePointer ptr, object obj, uint lifeSpanSec = 0U, bool link = true)
Parameters
Type Name Description
PilePointer ptr
System.Object obj
System.UInt32 lifeSpanSec
System.Boolean link
Returns
Type Description
System.Boolean

Put(Object, UInt32, Int32)

Puts a CLR object into the pile and returns a newly-allocated pointer. Throws out-of-space if there is not enough space in the pile and limits are set. Optional lifeSpanSec is ignored by this implementation

Declaration
public PilePointer Put(object obj, uint lifeSpanSec = 0U, int preallocateBlockSize = 0)
Parameters
Type Name Description
System.Object obj
System.UInt32 lifeSpanSec
System.Int32 preallocateBlockSize
Returns
Type Description
PilePointer

Rejuvenate(PilePointer)

Declaration
public bool Rejuvenate(PilePointer ptr)
Parameters
Type Name Description
PilePointer ptr
Returns
Type Description
System.Boolean

SizeOf(PilePointer)

Declaration
public int SizeOf(PilePointer ptr)
Parameters
Type Name Description
PilePointer ptr
Returns
Type Description
System.Int32

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

Implements

ILocalizedTimeProvider
IPileImplementation
IPile
IPileStatus
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
IApplicationComponent
System.IDisposable
IService
INamed
IConfigurable
IInstrumentable
IExternallyParameterized

Extension Methods

CollectionUtils.ForEach<T>(IEnumerable<T>, Action<T>)
CollectionUtils.ForEach<T>(IEnumerable<T>, Action<T, Int32>)
CollectionUtils.SkipLast<T>(IEnumerable<T>)
CollectionUtils.SkipLast<T>(IEnumerable<T>, Int32)
CollectionUtils.FirstMin<TResult, TComparand>(IEnumerable<TResult>, Func<TResult, TComparand>)
CollectionUtils.FirstMin<TResult, TComparand>(IEnumerable<TResult>, Func<TResult, TComparand>, out TComparand)
CollectionUtils.FirstMax<TResult, TComparand>(IEnumerable<TResult>, Func<TResult, TComparand>)
CollectionUtils.FirstMax<TResult, TComparand>(IEnumerable<TResult>, Func<TResult, TComparand>, out TComparand)
CollectionUtils.FirstOrAnyOrDefault<TResult>(IEnumerable<TResult>, Func<TResult, Boolean>)
CollectionUtils.Distinct<TResult, TKey>(IEnumerable<TResult>, Func<TResult, TKey>)
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)
LookAheadExtensions.AsLookAheadEnumerable<T>(IEnumerable<T>)
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