Example #1
0
 private void Init(List <byte[]> indexIdList,
                   List <int> primaryIdList,
                   string targetIndexName,
                   bool excludeData,
                   bool getIndexHeader,
                   Filter filter,
                   FullDataIdInfo fullDataIdInfo,
                   int count,
                   IndexCondition indexCondition,
                   int maxResultItems,
                   bool canApplyMaxResultItemsOnServer,
                   DomainSpecificProcessingType domainSpecificProcessingType)
 {
     IndexIdList                  = indexIdList;
     PrimaryIdList                = primaryIdList;
     TargetIndexName              = targetIndexName;
     ExcludeData                  = excludeData;
     GetIndexHeader               = getIndexHeader;
     Filter                       = filter;
     FullDataIdInfo               = fullDataIdInfo;
     Count                        = count;
     IndexCondition               = indexCondition;
     MaxResultItems               = maxResultItems;
     IsSingleClusterQuery         = canApplyMaxResultItemsOnServer;
     DomainSpecificProcessingType = domainSpecificProcessingType;
 }
 private void Init(List <byte[]> indexIdList,
                   List <int> primaryIdList,
                   string targetIndexName,
                   List <string> tagsFromIndexes,
                   TagSort tagSort,
                   int maxItems,
                   bool excludeData,
                   bool getIndexHeader,
                   Dictionary <byte[], IndexIdParams> indexIdParamsMapping,
                   bool getAdditionalAvailableItemCount,
                   Filter filter,
                   FullDataIdInfo fullDataIdInfo,
                   IndexCondition indexCondition,
                   bool clientSideSubsetProcessingRequired,
                   CapCondition capCondition,
                   GetIndexHeaderType getIndexHeaderType)
 {
     IndexIdList                     = indexIdList;
     PrimaryIdList                   = primaryIdList;
     TargetIndexName                 = targetIndexName;
     TagsFromIndexes                 = tagsFromIndexes;
     TagSort                         = tagSort;
     MaxItems                        = maxItems;
     ExcludeData                     = excludeData;
     GetIndexHeader                  = getIndexHeader;
     IndexIdParamsMapping            = indexIdParamsMapping;
     GetAdditionalAvailableItemCount = getAdditionalAvailableItemCount;
     Filter         = filter;
     FullDataIdInfo = fullDataIdInfo;
     IndexCondition = indexCondition;
     ClientSideSubsetProcessingRequired = clientSideSubsetProcessingRequired;
     CapCondition       = capCondition;
     GetIndexHeaderType = getIndexHeaderType;
 }
Example #3
0
 private void Init(List <byte[]> indexIdList,
                   List <int> primaryIdList,
                   int pageSize,
                   int pageNum,
                   string targetIndexName,
                   List <string> tagsFromIndexes,
                   TagSort tagSort,
                   int maxItemsPerIndex,
                   bool excludeData,
                   bool getIndexHeader,
                   Dictionary <byte[], IndexIdParams> indexIdParamsMapping,
                   bool getPageableItemCount,
                   Filter filter,
                   FullDataIdInfo fullDataIdInfo,
                   IndexCondition indexCondition,
                   bool clientSidePaging)
 {
     IndexIdList          = indexIdList;
     PrimaryIdList        = primaryIdList;
     PageSize             = pageSize;
     PageNum              = pageNum;
     TargetIndexName      = targetIndexName;
     TagsFromIndexes      = tagsFromIndexes;
     TagSort              = tagSort;
     MaxItemsPerIndex     = maxItemsPerIndex;
     ExcludeData          = excludeData;
     GetIndexHeader       = getIndexHeader;
     IndexIdParamsMapping = indexIdParamsMapping;
     GetPageableItemCount = getPageableItemCount;
     Filter           = filter;
     FullDataIdInfo   = fullDataIdInfo;
     IndexCondition   = indexCondition;
     ClientSidePaging = clientSidePaging;
 }
        /// <summary>
        /// Gets the data into resultItemList items.
        /// </summary>
        /// <param name="resultItemList">The result item list.</param>
        /// <param name="storeContext">The store context.</param>
        /// <param name="messageContext">The message context.</param>
        /// <param name="fullDataIdFieldList">The full data id field list.</param>
        /// <param name="fullDataIdInfo">The full data id info.</param>
        internal static void GetData(List<ResultItem> resultItemList,
            IndexStoreContext storeContext,
            MessageContext messageContext,
            FullDataIdFieldList fullDataIdFieldList,
            FullDataIdInfo fullDataIdInfo)
        {
            byte[] extendedId;
            List<RelayMessage> dataStoreMessages = new List<RelayMessage>();
            short relatedTypeId;
            if (fullDataIdInfo != null && fullDataIdInfo.RelatedTypeName != null)
            {
                if (!storeContext.TryGetTypeId(fullDataIdInfo.RelatedTypeName, out relatedTypeId))
                {
                    LoggingUtil.Log.ErrorFormat("Invalid RelatedCacheTypeName - {0}", fullDataIdInfo.RelatedTypeName);
                    throw new Exception("Invalid RelatedTypeId for TypeId - " + fullDataIdInfo.RelatedTypeName);
                }
            }
            else if (!storeContext.TryGetRelatedIndexTypeId(messageContext.TypeId, out relatedTypeId))
            {
                LoggingUtil.Log.ErrorFormat("Invalid RelatedTypeId for TypeId - {0}", messageContext.TypeId);
                throw new Exception("Invalid RelatedTypeId for TypeId - " + messageContext.TypeId);
            }

            if (resultItemList != null && resultItemList.Count > 0)
            {
                foreach (ResultItem resultItem in resultItemList)
                {
                    extendedId = GetFullDataId(resultItem.IndexId,
                        resultItem,
                        fullDataIdInfo != null && fullDataIdInfo.RelatedTypeName != null ? fullDataIdInfo.FullDataIdFieldList : fullDataIdFieldList);
                    dataStoreMessages.Add(new RelayMessage(relatedTypeId,
                                              IndexCacheUtils.GeneratePrimaryId(extendedId),
                                              extendedId,
                                              MessageType.Get));
                }

                storeContext.ForwarderComponent.HandleMessages(dataStoreMessages);

                int i = 0;
                foreach (ResultItem resultItem in resultItemList)
                {
                    if (dataStoreMessages[i].Payload != null)
                    {
                        resultItem.Data = dataStoreMessages[i].Payload.ByteArray;
                    }
                    else
                    {
                        LoggingUtil.Log.DebugFormat("Fetched Null Data for TypeId: {0}, IndexId: {1}, ItemId: {2}, FullDataId: {3}, PrimaryId: {4}",
                            relatedTypeId,
                            IndexCacheUtils.GetReadableByteArray(resultItem.IndexId),
                            IndexCacheUtils.GetReadableByteArray(resultItem.ItemId),
                            IndexCacheUtils.GetReadableByteArray(dataStoreMessages[i].ExtendedId),
                            IndexCacheUtils.GeneratePrimaryId(dataStoreMessages[i].ExtendedId)
                            );
                    }
                    i++;
                }
            }
        }
Example #5
0
 private void Init(byte[] indexId, int firstPageSize, int lastPageSize, string targetIndexName, bool excludeData, bool getMetadata, FullDataIdInfo fullDataIdInfo)
 {
     this.indexId         = indexId;
     this.firstPageSize   = firstPageSize;
     this.lastPageSize    = lastPageSize;
     this.targetIndexName = targetIndexName;
     this.excludeData     = excludeData;
     this.getMetadata     = getMetadata;
     this.fullDataIdInfo  = fullDataIdInfo;
 }
        public void GetDataItems(FullDataIdInfo info, bool excludeData, MessageContext messageContext, IndexStoreContext storeContext, BaseMultiIndexIdQueryResult queryResult)
        {
            if (excludeData == false)
            {
                IndexTypeMapping indexTypeMapping =
                storeContext.StorageConfiguration.CacheIndexV3StorageConfig.IndexTypeMappingCollection[messageContext.TypeId];

                DataTierUtil.GetData(queryResult.ResultItemList, storeContext, messageContext, indexTypeMapping.FullDataIdFieldList, info);
            }
        }
Example #7
0
 private void Init(byte[] indexId, int count, string targetIndexName, bool excludeData, bool getMetadata, Filter filter, FullDataIdInfo fullDataIdInfo)
 {
     IndexId         = indexId;
     Count           = count;
     TargetIndexName = targetIndexName;
     ExcludeData     = excludeData;
     GetMetadata     = getMetadata;
     Filter          = filter;
     FullDataIdInfo  = fullDataIdInfo;
 }
Example #8
0
 private void Init(byte[] indexId, int offset, int itemNum, string targetIndexName, bool excludeData, bool getMetadata, FullDataIdInfo fullDataIdInfo)
 {
     IndexId         = indexId;
     Offset          = offset;
     ItemNum         = itemNum;
     TargetIndexName = targetIndexName;
     ExcludeData     = excludeData;
     GetMetadata     = getMetadata;
     FullDataIdInfo  = fullDataIdInfo;
 }
 private void Init(byte[] indexId, int offset, int itemNum, string targetIndexName, bool excludeData, bool getMetadata, FullDataIdInfo fullDataIdInfo)
 {
     this.indexId         = indexId;
     this.offset          = offset;
     this.itemNum         = itemNum;
     this.targetIndexName = targetIndexName;
     this.excludeData     = excludeData;
     this.getMetadata     = getMetadata;
     this.fullDataIdInfo  = fullDataIdInfo;
 }
 private void Init(byte[] indexId, int count, string targetIndexName, bool excludeData, bool getMetadata, Filter filter, FullDataIdInfo fullDataIdInfo)
 {
     this.indexId         = indexId;
     this.count           = count;
     this.targetIndexName = targetIndexName;
     this.excludeData     = excludeData;
     this.getMetadata     = getMetadata;
     this.filter          = filter;
     this.fullDataIdInfo  = fullDataIdInfo;
 }
Example #11
0
 private void Init(byte[] indexId, int firstPageSize, int lastPageSize, string targetIndexName, bool excludeData, bool getMetadata, FullDataIdInfo fullDataIdInfo)
 {
     IndexId         = indexId;
     FirstPageSize   = firstPageSize;
     LastPageSize    = lastPageSize;
     TargetIndexName = targetIndexName;
     ExcludeData     = excludeData;
     GetMetadata     = getMetadata;
     FullDataIdInfo  = fullDataIdInfo;
 }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //IndexItemList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                IndexItem indexItem;
                indexItemList = new List <IndexItem>(count);
                for (ushort i = 0; i < count; i++)
                {
                    indexItem = new IndexItem();
                    indexItem.Deserialize(reader);
                    indexItemList.Add(indexItem);
                }
            }

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //TagsFromIndexes
            count           = reader.ReadUInt16();
            tagsFromIndexes = new List <string>(count);
            if (count > 0)
            {
                for (ushort i = 0; i < count; i++)
                {
                    tagsFromIndexes.Add(reader.ReadString());
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
Example #13
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    IndexId = reader.ReadBytes(len);
                }

                //Count
                Count = reader.ReadInt32();

                //TargetIndexName
                TargetIndexName = reader.ReadString();

                //ExcludeData
                ExcludeData = reader.ReadBoolean();

                //GetMetadata
                GetMetadata = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    Filter = FilterFactory.CreateFilter(reader, filterType);
                }

                //FullDataIdInfo
                if (reader.ReadBoolean())
                {
                    FullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
                }

                //IndexCondition
                if (reader.ReadBoolean())
                {
                    IndexCondition = new IndexCondition();
                    Serializer.Deserialize(reader.BaseStream, IndexCondition);
                }

                if (version >= 2)
                {
                    //DomainSpecificProcessingType
                    DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
                }
            }
        }
Example #14
0
 private void Init(byte[] indexId,
                   List <IndexItem> indexItemList,
                   string targetIndexName,
                   List <string> tagsFromIndexes,
                   bool excludeData,
                   bool getMetadata,
                   FullDataIdInfo fullDataIdInfo)
 {
     IndexId         = indexId;
     IndexItemList   = indexItemList;
     TargetIndexName = targetIndexName;
     TagsFromIndexes = tagsFromIndexes;
     ExcludeData     = excludeData;
     GetMetadata     = getMetadata;
     FullDataIdInfo  = fullDataIdInfo;
 }
 private void Init(byte[] indexId,
                   List <IndexItem> indexItemList,
                   string targetIndexName,
                   List <string> tagsFromIndexes,
                   bool excludeData,
                   bool getMetadata,
                   FullDataIdInfo fullDataIdInfo)
 {
     this.indexId         = indexId;
     this.indexItemList   = indexItemList;
     this.targetIndexName = targetIndexName;
     this.tagsFromIndexes = tagsFromIndexes;
     this.excludeData     = excludeData;
     this.getMetadata     = getMetadata;
     this.fullDataIdInfo  = fullDataIdInfo;
 }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //Offset
            offset = reader.ReadInt32();

            //ItemNum
            itemNum = reader.ReadInt32();

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }
            }

            if (version >= 3)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
Example #17
0
 private void Init(List <byte[]> indexIdList,
                   List <int> primaryIdList,
                   string targetIndexName,
                   bool excludeData,
                   bool getIndexHeader,
                   Dictionary <byte[], IntersectionQueryParams> intersectionQueryParamsMapping,
                   Filter filter,
                   FullDataIdInfo fullDataIdInfo)
 {
     this.indexIdList     = indexIdList;
     this.primaryIdList   = primaryIdList;
     this.targetIndexName = targetIndexName;
     this.excludeData     = excludeData;
     this.getIndexHeader  = getIndexHeader;
     this.intersectionQueryParamsMapping = intersectionQueryParamsMapping;
     this.filter         = filter;
     this.fullDataIdInfo = fullDataIdInfo;
 }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    indexId = reader.ReadBytes(len);
                }

                //Count
                count = reader.ReadInt32();

                //TargetIndexName
                targetIndexName = reader.ReadString();

                //ExcludeData
                excludeData = reader.ReadBoolean();

                //GetMetadata
                getMetadata = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }

                if (version >= 2)
                {
                    //FullDataIdInfo
                    fullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
                }
            }
        }
 private void Init(List <byte[]> indexIdList,
                   List <IndexItem> indexItemList,
                   string targetIndexName,
                   bool excludeData,
                   bool getIndexHeader,
                   List <int> primaryIdList,
                   Filter filter,
                   FullDataIdInfo fullDataIdInfo,
                   int count,
                   IndexCondition indexCondition,
                   DomainSpecificProcessingType domainSpecificProcessingType)
 {
     IndexIdList     = indexIdList;
     IndexItemList   = indexItemList;
     TargetIndexName = targetIndexName;
     ExcludeData     = excludeData;
     GetIndexHeader  = getIndexHeader;
     PrimaryIdList   = primaryIdList;
     Filter          = filter;
     FullDataIdInfo  = fullDataIdInfo;
     Count           = count;
     IndexCondition  = indexCondition;
     DomainSpecificProcessingType = domainSpecificProcessingType;
 }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();
            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //FirstPageSize
            firstPageSize = reader.ReadInt32();

            //LastPageSize
            lastPageSize = reader.ReadInt32();

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }
            }

            if(version >= 3)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
Example #21
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    indexId = reader.ReadBytes(len);
                }

                //Count
                count = reader.ReadInt32();

                //TargetIndexName
                targetIndexName = reader.ReadString();

                //ExcludeData
                excludeData = reader.ReadBoolean();

                //GetMetadata
                getMetadata = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType) b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }

                if (version >= 2)
                {
                    //FullDataIdInfo
                    fullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
                }
            }
        }
Example #22
0
 private void Init(byte[] indexId, int count, string targetIndexName, bool excludeData, bool getMetadata, Filter filter, FullDataIdInfo fullDataIdInfo)
 {
     this.indexId = indexId;
     this.count = count;
     this.targetIndexName = targetIndexName;
     this.excludeData = excludeData;
     this.getMetadata = getMetadata;
     this.filter = filter;
     this.fullDataIdInfo = fullDataIdInfo;
 }
 private void Init(byte[] indexId, int offset, int itemNum, string targetIndexName, bool excludeData, bool getMetadata, FullDataIdInfo fullDataIdInfo)
 {
     this.indexId = indexId;
     this.offset = offset;
     this.itemNum = itemNum;
     this.targetIndexName = targetIndexName;
     this.excludeData = excludeData;
     this.getMetadata = getMetadata;
     this.fullDataIdInfo = fullDataIdInfo;
 }
Example #24
0
        public virtual void Deserialize(IPrimitiveReader reader, int version)
        {
            //TargetIndexName
            targetIndexName = reader.ReadString();

            //IndexIdList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                indexIdList = new List <byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        indexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetIndexHeader
            getIndexHeader = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                primaryIdList = new List <int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    primaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();

            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                intersectionQueryParamsMapping = new Dictionary <byte[], IntersectionQueryParams>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                IntersectionQueryParams intersectionQueryParam;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len     = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        intersectionQueryParam = new IntersectionQueryParams();
                        Serializer.Deserialize(reader.BaseStream, intersectionQueryParam);

                        intersectionQueryParamsMapping.Add(indexId, intersectionQueryParam);
                    }
                }
            }

            if (version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
Example #25
0
        public virtual void Deserialize(IPrimitiveReader reader, int version)
        {
            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //IndexIdList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                IndexIdList = new List <byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        IndexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetIndexHeader
            GetIndexHeader = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                PrimaryIdList = new List <int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    PrimaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();

            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                Filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                intersectionQueryParamsMapping = new Dictionary <byte[], IntersectionQueryParams>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                IntersectionQueryParams intersectionQueryParam;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len     = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        intersectionQueryParam = new IntersectionQueryParams();
                        Serializer.Deserialize(reader.BaseStream, intersectionQueryParam);

                        intersectionQueryParamsMapping.Add(indexId, intersectionQueryParam);
                    }
                }
            }

            if (version == 2)
            {
                //FullDataIdInfo
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            if (version >= 3)
            {
                //FullDataIdInfo
                if (reader.ReadBoolean())
                {
                    FullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
                }

                //Count
                Count = reader.ReadInt32();

                //MaxResultItems
                MaxResultItems = reader.ReadInt32();


                //CanApplyMaxResultItemsOnServer
                IsSingleClusterQuery = reader.ReadBoolean();

                //IndexCondition
                if (reader.ReadBoolean())
                {
                    IndexCondition = new IndexCondition();
                    Serializer.Deserialize(reader.BaseStream, IndexCondition);
                }
            }

            if (version >= 4)
            {
                //DomainSpecificProcessingType
                DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
            }
        }
 private void Init(byte[] indexId, int firstPageSize, int lastPageSize, string targetIndexName, bool excludeData, bool getMetadata, FullDataIdInfo fullDataIdInfo)
 {
     this.indexId = indexId;
     this.firstPageSize = firstPageSize;
     this.lastPageSize = lastPageSize;
     this.targetIndexName = targetIndexName;
     this.excludeData = excludeData;
     this.getMetadata = getMetadata;
     this.fullDataIdInfo = fullDataIdInfo;
 }
Example #27
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                IndexId = reader.ReadBytes(len);
            }

            //Offset
            Offset = reader.ReadInt32();

            //ItemNum
            ItemNum = reader.ReadInt32();

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetMetadata
            GetMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    Filter = FilterFactory.CreateFilter(reader, filterType);
                }
            }

            if (version == 3)
            {
                //FullDataIdInfo
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            if (version >= 4)
            {
                //FullDataIdInfo
                if (reader.ReadBoolean())
                {
                    FullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
                }

                //TagSort
                if (reader.ReadBoolean())
                {
                    TagSort = new TagSort();
                    Serializer.Deserialize(reader.BaseStream, TagSort);
                }
            }

            if (version >= 5)
            {
                //IndexCondition
                if (reader.ReadBoolean())
                {
                    IndexCondition = new IndexCondition();
                    Serializer.Deserialize(reader.BaseStream, IndexCondition);
                }
            }

            if (version >= 6)
            {
                //DomainSpecificProcessingType
                DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
            }
        }
Example #28
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                IndexId = reader.ReadBytes(len);
            }

            //IndexItemList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                IndexItem indexItem;
                IndexItemList = new List <IndexItem>(count);
                for (ushort i = 0; i < count; i++)
                {
                    indexItem = new IndexItem();
                    indexItem.Deserialize(reader);
                    IndexItemList.Add(indexItem);
                }
            }

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //TagsFromIndexes
            count           = reader.ReadUInt16();
            TagsFromIndexes = new List <string>(count);
            if (count > 0)
            {
                for (ushort i = 0; i < count; i++)
                {
                    TagsFromIndexes.Add(reader.ReadString());
                }
            }

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetMetadata
            GetMetadata = reader.ReadBoolean();

            if (version == 2)
            {
                //FullDataIdInfo
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            if (version >= 3)
            {
                //FullDataIdInfo
                if (reader.ReadBoolean())
                {
                    FullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
                }

                //DomainSpecificProcessingType
                DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexIdList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                IndexIdList = new List <byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        IndexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //IndexItemList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexItem indexItem;
                IndexItemList = new List <IndexItem>(count);
                for (ushort i = 0; i < count; i++)
                {
                    indexItem = new IndexItem();
                    indexItem.Deserialize(reader);
                    IndexItemList.Add(indexItem);
                }
            }

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetIndexHeader
            GetIndexHeader = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                PrimaryIdList = new List <int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    PrimaryIdList.Add(reader.ReadInt32());
                }
            }

            //MultiIndexContainsQueryParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                MultiIndexContainsQueryParamsMapping = new Dictionary <byte[], MultiIndexContainsQueryParams>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                MultiIndexContainsQueryParams multiIndexContainsQueryParams;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len     = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        multiIndexContainsQueryParams = null;
                        if (reader.ReadBoolean())
                        {
                            multiIndexContainsQueryParams = new MultiIndexContainsQueryParams();
                            Serializer.Deserialize(reader.BaseStream, multiIndexContainsQueryParams);
                        }

                        MultiIndexContainsQueryParamsMapping.Add(indexId, multiIndexContainsQueryParams);
                    }
                }
            }

            //FullDataIdInfo
            if (reader.ReadBoolean())
            {
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            //Count
            Count = reader.ReadInt32();

            //IndexCondition
            if (reader.ReadBoolean())
            {
                IndexCondition = new IndexCondition();
                Serializer.Deserialize(reader.BaseStream, IndexCondition);
            }

            if (version >= 2)
            {
                //DomainSpecificProcessingType
                DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
            }
        }
		public void Deserialize(IPrimitiveReader reader, int version)
		{
            //IndexId
            ushort len = reader.ReadUInt16();
            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //IndexItemList
            ushort count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexItem indexItem;
                indexItemList = new List<IndexItem>(count);
                for (ushort i = 0; i < count; i++)
                {
                    indexItem = new IndexItem();
                    indexItem.Deserialize(reader);
                    indexItemList.Add(indexItem);
                }
            }

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //TagsFromIndexes
            count = reader.ReadUInt16();
            tagsFromIndexes = new List<string>(count);
            if (count > 0)
            {
                for (ushort i = 0; i < count; i++)
                {
                    tagsFromIndexes.Add(reader.ReadString());
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if(version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
		}
        private void Init(byte[] indexId, 
            List<IndexItem> indexItemList, 
            string targetIndexName, 
            List<string> tagsFromIndexes, 
            bool excludeData, 
            bool getMetadata,
            FullDataIdInfo fullDataIdInfo)
		{
			this.indexId = indexId;
            this.indexItemList = indexItemList;
			this.targetIndexName = targetIndexName;
			this.tagsFromIndexes = tagsFromIndexes;
			this.excludeData = excludeData;
			this.getMetadata = getMetadata;
            this.fullDataIdInfo = fullDataIdInfo;
		}
        public virtual void Deserialize(IPrimitiveReader reader, int version)
        {
            //TargetIndexName
            targetIndexName = reader.ReadString();

            //IndexIdList
            ushort count = reader.ReadUInt16();
            if (count > 0)
            {
                indexIdList = new List<byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        indexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetIndexHeader
            getIndexHeader = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                primaryIdList = new List<int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    primaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();
            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                intersectionQueryParamsMapping = new Dictionary<byte[], IntersectionQueryParams>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                IntersectionQueryParams intersectionQueryParam;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        intersectionQueryParam = new IntersectionQueryParams();
                        Serializer.Deserialize(reader.BaseStream, intersectionQueryParam);

                        intersectionQueryParamsMapping.Add(indexId, intersectionQueryParam);
                    }
                }
            }

            if (version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            //Offset
            Offset = reader.ReadInt32();

            //Span
            Span = reader.ReadInt32();

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //TagsFromIndexes
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                TagsFromIndexes = new List <string>(count);
                for (ushort i = 0; i < count; i++)
                {
                    TagsFromIndexes.Add(reader.ReadString());
                }
            }

            //TagSort
            if (reader.ReadByte() != 0)
            {
                TagSort = new TagSort();
                Serializer.Deserialize(reader.BaseStream, TagSort);
            }

            //IndexIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexIdList = new List <byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        IndexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //MaxItemsPerIndex
            MaxItems = reader.ReadInt32();

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetIndexHeader
            GetIndexHeader = reader.ReadBoolean();

            //GetPageableItemCount
            GetAdditionalAvailableItemCount = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                PrimaryIdList = new List <int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    PrimaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();

            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                Filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexIdParamsMapping = new Dictionary <byte[], IndexIdParams>(count, new ByteArrayEqualityComparer());
                byte[]        indexId;
                IndexIdParams indexIdParam;
                ushort        len;

                for (ushort i = 0; i < count; i++)
                {
                    len     = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        indexIdParam = new IndexIdParams();
                        Serializer.Deserialize(reader.BaseStream, indexIdParam);

                        IndexIdParamsMapping.Add(indexId, indexIdParam);
                    }
                }
            }

            //FullDataIdInfo
            if (reader.ReadBoolean())
            {
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            //ClientSideSubsetProcessingRequired
            ClientSideSubsetProcessingRequired = reader.ReadBoolean();

            if (version >= 2)
            {
                //CapCondition
                if (reader.ReadBoolean())
                {
                    CapCondition = new CapCondition();
                    Serializer.Deserialize(reader.BaseStream, CapCondition);
                }
            }

            if (version >= 3)
            {
                //GetIndexHeaderType
                GetIndexHeaderType = (GetIndexHeaderType)reader.ReadByte();
            }
        }
 private void Init(List<byte[]> indexIdList,
     List<int> primaryIdList,
     string targetIndexName,
     bool excludeData,
     bool getIndexHeader,
     Dictionary<byte[], IntersectionQueryParams> intersectionQueryParamsMapping,
     Filter filter,
     FullDataIdInfo fullDataIdInfo)
 {
     this.indexIdList = indexIdList;
     this.primaryIdList = primaryIdList;
     this.targetIndexName = targetIndexName;
     this.excludeData = excludeData;
     this.getIndexHeader = getIndexHeader;
     this.intersectionQueryParamsMapping = intersectionQueryParamsMapping;
     this.filter = filter;
     this.fullDataIdInfo = fullDataIdInfo;
 }