/// <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++; } } }
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); } }