예제 #1
0
        public override void Deserialize(ref SerializationReader mySerializationReader)
        {
            UInt32 _Capacity;

            if (mySerializationReader != null)
            {
                try
                {
                    _UUID = new TypeUUID(this.ObjectUUID.GetByteArray());
                    ParentTypeUUID = new TypeUUID();
                    ParentTypeUUID.Deserialize(ref mySerializationReader);
                    _IsUserDefined = mySerializationReader.ReadBoolean();
                    _IsAbstract = mySerializationReader.ReadBoolean();
                    _Comment = mySerializationReader.ReadString();

                    _Capacity = mySerializationReader.ReadUInt32();

                    _Attributes = new Dictionary<AttributeUUID, TypeAttribute>();

                    _TypeAttributeLookupTable = new Dictionary<AttributeUUID, TypeAttribute>();

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        var _AttrAtrib = new AttributeUUID();
                        _AttrAtrib.Deserialize(ref mySerializationReader);
                        var _TypeObj = new TypeAttribute();
                        _TypeObj.Deserialize(ref mySerializationReader);
                        _Attributes.Add(_AttrAtrib, _TypeObj);
                        _TypeAttributeLookupTable.Add(_AttrAtrib, _TypeObj);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _TypeSettings = new Dictionary<String, ADBSettingsBase>();

                    for (var i = 0; i < _Capacity; i++)
                    {
                        ADBSettingsBase _ADBSettingsBase = (ADBSettingsBase) mySerializationReader.ReadObject();
                        if(_ADBSettingsBase != null)
                            _TypeSettings.Add(_ADBSettingsBase.Name, _ADBSettingsBase);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _UniqueAttributes = new List<AttributeUUID>();
                    AttributeUUID AttribID = null;

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        AttribID = new AttributeUUID(ref mySerializationReader);
                        _UniqueAttributes.Add(AttribID);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _MandatoryAttributes = new HashSet<AttributeUUID>();

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        AttribID = new AttributeUUID(ref mySerializationReader);
                        _MandatoryAttributes.Add(AttribID);
                    }

                    ObjectDirectoryShards = mySerializationReader.ReadUInt16();

                    #region Indices

                    _AttributeIndices = new Dictionary<IndexKeyDefinition, Dictionary<String, AAttributeIndex>>();
                    _AttributeIndicesNameLookup = new Dictionary<String, IndexKeyDefinition>();

                    var idxCount = mySerializationReader.ReadUInt32();
                    for (var i = 0; i < idxCount; i++)
                    {

                        var idxKey = new IndexKeyDefinition();
                        idxKey.Deserialize(ref mySerializationReader);

                        //_AttributeIndices.Add(idxKey, new Dictionary<String, AttributeIndex>());

                        var idxVersionCount = mySerializationReader.ReadUInt32();

                        for (var j = 0; j < idxVersionCount; j++)
                        {

                            var key                 = mySerializationReader.ReadString();
                            var fileSystemLocation  = new ObjectLocation(mySerializationReader.ReadString());
                            var indexEdition        = mySerializationReader.ReadString();
                            var indexName           = mySerializationReader.ReadString();
                            var indexType           = mySerializationReader.ReadString();
                            var isUUIDIdx           = mySerializationReader.ReadBoolean();
                            var keyCount            = mySerializationReader.ReadUInt64();
                            var valueCount          = mySerializationReader.ReadUInt64();
                            var attributeIdxShards = mySerializationReader.ReadUInt16();

                            //var CreateIdxExcept = CreateAttributeIndex(indexName, idxKey.IndexKeyAttributeUUIDs, indexEdition, indexObjectType, fileSystemLocation);

                            if (isUUIDIdx)
                            {
                                AddAttributeIndex(new UUIDIndex(indexName, idxKey, this, attributeIdxShards, indexType, indexEdition, keyCount));
                            }
                            else
                            {
                                AddAttributeIndex(new AttributeIndex(indexName, idxKey, this, attributeIdxShards, indexType, indexEdition, keyCount, valueCount));
                            }

                            //if (CreateIdxExcept.Failed())
                            //    throw new GraphDBException(CreateIdxExcept.Errors);
                        }

                    }

                    #endregion

                }

                catch (Exception e)
                {
                    throw new SerializationException("The GraphDBType could not be deserialized!\n\n" + e);
                }

            }
        }
예제 #2
0
파일: GraphDBType.cs 프로젝트: Vadi/sones
        public override void Deserialize(ref SerializationReader mySerializationReader)
        {
            UInt32 _Capacity;

            if (mySerializationReader != null)
            {
                try
                {
                    _UUID = new TypeUUID(this.ObjectUUID.GetByteArray());
                    ParentTypeUUID = new TypeUUID();
                    ParentTypeUUID.Deserialize(ref mySerializationReader);
                    _IsUserDefined = mySerializationReader.ReadBoolean();
                    _IsAbstract = mySerializationReader.ReadBoolean();
                    _Comment = mySerializationReader.ReadString();

                    _Capacity = mySerializationReader.ReadUInt32();

                    _Attributes = new Dictionary<AttributeUUID, TypeAttribute>();

                    _TypeAttributeLookupTable = new Dictionary<AttributeUUID, TypeAttribute>();

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        var _AttrAtrib = new AttributeUUID();
                        _AttrAtrib.Deserialize(ref mySerializationReader);
                        var _TypeObj = new TypeAttribute();
                        _TypeObj.Deserialize(ref mySerializationReader);
                        _Attributes.Add(_AttrAtrib, _TypeObj);
                        _TypeAttributeLookupTable.Add(_AttrAtrib, _TypeObj);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _TypeSettings = new Dictionary<String, ADBSettingsBase>();

                    for (var i = 0; i < _Capacity; i++)
                    {
                        ADBSettingsBase _ADBSettingsBase = (ADBSettingsBase) mySerializationReader.ReadObject();
                        if(_ADBSettingsBase != null)
                            _TypeSettings.Add(_ADBSettingsBase.Name, _ADBSettingsBase);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _UniqueAttributes = new List<AttributeUUID>();
                    AttributeUUID AttribID = null;

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        AttribID = new AttributeUUID(ref mySerializationReader);
                        _UniqueAttributes.Add(AttribID);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _MandatoryAttributes = new HashSet<AttributeUUID>();

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        AttribID = new AttributeUUID(ref mySerializationReader);
                        _MandatoryAttributes.Add(AttribID);
                    }

                    #region Indices

                    _AttributeIndices = new Dictionary<IndexKeyDefinition, Dictionary<String, AAttributeIndex>>();
                    _AttributeIndicesNameLookup = new Dictionary<String, IndexKeyDefinition>();
                    _AttributeIndexLocations = new Dictionary<IndexKeyDefinition, Dictionary<string, Tuple<string, ObjectLocation>>>();

                    var idxCount = mySerializationReader.ReadUInt32();
                    for (var i = 0; i < idxCount; i++)
                    {

                        var idxKey = new IndexKeyDefinition();
                        idxKey.Deserialize(ref mySerializationReader);

                        //_AttributeIndices.Add(idxKey, new Dictionary<String, AttributeIndex>());

                        var idxVersionCount = mySerializationReader.ReadUInt32();

                        _AttributeIndexLocations.Add(idxKey, new Dictionary<string, Tuple<string, ObjectLocation>>());
                        for (var j = 0; j < idxVersionCount; j++)
                        {

                            var key                 = mySerializationReader.ReadString();
                            var idxLocation         = mySerializationReader.ReadString();
                            var indexType           = mySerializationReader.ReadString();

                            _AttributeIndexLocations[idxKey][key] = new Tuple<string,ObjectLocation>(indexType, new ObjectLocation(idxLocation));

                            //idx.IndexKeyDefinition  = idxKey;
                            //AddAttributeIndex(idx as AAttributeIndex);

                        }

                    }

                    #endregion

                }

                catch (Exception e)
                {
                    throw new SerializationException("The GraphDBType could not be deserialized!\n\n" + e);
                }

            }
        }
예제 #3
0
 public override void Deserialize(ref Lib.NewFastSerializer.SerializationReader mySerializationReader)
 {
     FileSystemLocation  = new ObjectLocation(ObjectLocation.ParseString(mySerializationReader.ReadString()));
     IndexEdition        = mySerializationReader.ReadString();
     IndexName           = mySerializationReader.ReadString();
     _IsUUIDIndex        = mySerializationReader.ReadBoolean();
     IndexKeyDefinition = new IndexKeyDefinition();
     IndexKeyDefinition.Deserialize(ref mySerializationReader);
     IndexRelatedTypeUUID = new TypeUUID(ref mySerializationReader);
 }
예제 #4
0
파일: UUIDIndex.cs 프로젝트: Vadi/sones
 public override void Deserialize(ref Lib.NewFastSerializer.SerializationReader mySerializationReader)
 {
     _KeyCount = mySerializationReader.ReadUInt64();
     IndexName = mySerializationReader.ReadString();
     IndexEdition = mySerializationReader.ReadString();
     IndexKeyDefinition = new IndexKeyDefinition();
     IndexKeyDefinition.Deserialize(ref mySerializationReader);
     IndexRelatedTypeUUID = new TypeUUID(ref mySerializationReader);
 }