Show / Hide Table of Contents

Class DataParcelAttribute

Decorates Pacel-derivative classes specifying distributed data store options. Unlike the CRUD family of metadata attributes this attributed is NOT TARGETABLE on purpose beacause different sharding definitions would have affected the properties of the parcel which could have been very complex to maintain/account for. So, every parcel has ONLY ONE set opf metadata definition. In case when different parcel definitions needed a new parcel type should be created which can reuse the payload - this is much easier to implement (two parcels) than targeting within the same parcel. Table mappings are targetable

Inheritance
System.Object
System.Attribute
DataParcelAttribute
Implements
ICachePolicy
Inherited Members
System.Attribute.Equals(System.Object)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetHashCode()
System.Attribute.IsDefaultAttribute()
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.Match(System.Object)
System.Attribute.TypeId
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.DataAccess.Distributed
Assembly: NFX.dll
Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class DataParcelAttribute : Attribute, ICachePolicy

Constructors

DataParcelAttribute(String, String, Boolean, Type, String, String, Int32, Int32, Int32, String)

Declaration
public DataParcelAttribute(string schemaName, string areaName, bool supportsMerge = false, Type shardingParcel = null, string replicationChannel = null, string cacheTableName = null, int cacheWriteMaxAgeSec = -1, int cacheReadMaxAgeSec = -1, int cachePriority = -1, string targetTableMappings = null)
Parameters
Type Name Description
System.String schemaName
System.String areaName
System.Boolean supportsMerge
System.Type shardingParcel
System.String replicationChannel
System.String cacheTableName
System.Int32 cacheWriteMaxAgeSec
System.Int32 cacheReadMaxAgeSec
System.Int32 cachePriority
System.String targetTableMappings

Properties

AreaName

Specifies the Areaname - the logical subdivision in the store where parcels reside within the schema(see SchemaName): i.e. 'commonClinicalData'. Depending on a particular store setup this logical name may or may not represent physical servers/locations in the store. Every store implementation maps logical paths to physical servers and/or shards. This feature provides very high degree of distributed database design flexibility, as some parcels may represent common/dictionary data that does not need to be sharded, whereas others may represent purely transactional high-volume data that needs to be sharded. The value is required and is always specified or exception is thrown in .ctor

Declaration
public string AreaName { get; }
Property Value
Type Description
System.String
Remarks

Keep in mind that in a distributed database system various parcels may be stored not only in different locations, be optionally sharded, and even be stored in different back-end technologies (i.e. NoSQL/RDBMS/flat files)

CacheAbsoluteExpirationUTC

This property can not be set on the attribute level and always returns null

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

CachePriority

Specifies the relative cache priority of this parcel This property acts as a default, the runtime first checks parcel instance properties then reverts to this attribute

Declaration
public int ? CachePriority { get; }
Property Value
Type Description
System.Nullable<System.Int32>

CacheReadMaxAgeSec

Specifies the maximum age of parcel instance in cache to be suitable for reading This property acts as a default, the runtime first checks parcel instance properties then reverts to this attribute

Declaration
public int ? CacheReadMaxAgeSec { get; }
Property Value
Type Description
System.Nullable<System.Int32>

CacheTableName

Specifies the name of the cache table for this parcel This property acts as a default, the runtime first checks parcel instance properties then reverts to this attribute

Declaration
public string CacheTableName { get; }
Property Value
Type Description
System.String

CacheWriteMaxAgeSec

Specifies for how long should this parcel be cached in RAM after a write (after a saved change). This property acts as a default, the runtime first checks parcel instance properties then reverts to this attribute

Declaration
public int ? CacheWriteMaxAgeSec { get; }
Property Value
Type Description
System.Nullable<System.Int32>

ReplicationChannel

Specifies the name of the replication channel used to pump data between servers/data centers/locations

Declaration
public string ReplicationChannel { get; }
Property Value
Type Description
System.String

SchemaName

Specifies the name for logical schema that parcel decorated by this attribute belongs to. The exact location within the data store is detailed further with AreaName property. The value is required and is always specified or exception is thrown in .ctor

Declaration
public string SchemaName { get; }
Property Value
Type Description
System.String

ShardingParcel

Specifies the type of Parcel that is used for sharding. By default this parameter is null, so parcels are sharded on their own instance types, however there are cases when a parcel overrides ShardingID and specifies ShardingParcel type via this member so it gets stored along with the specified parcel

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

SupportsMerge

Returns true if parcel supports merge with other versions. Server may merge multiple parcel versions to resolve versioning conflict. Default implementation returns false

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

TableMappings

Returns mappins of target->table attributes. Pass in [DataParcel(targetTableMappings = "targetName1=tableName1{atr1=v1 atr2=v2...} targetName2=tableName2{atr1=v1 atr2=v2...}...")];

Declaration
public IRegistry<TargetTableMapping> TableMappings { get; }
Property Value
Type Description
IRegistry<TargetTableMapping>

Methods

GetParcelAttr(Type)

Returns DataParcelAttribute for a parcel type. Use Parcel.MetadataAttribute to obtain the attribute instance polymorphically for instance. If parcel is not decorated by the attribute then exception is thrown

Declaration
public static DataParcelAttribute GetParcelAttr(Type tparcel)
Parameters
Type Name Description
System.Type tparcel
Returns
Type Description
DataParcelAttribute

Implements

ICachePolicy

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