public LookupTable GetLookupTable(OnDemandProcessingContext odpContext) { if (this.m_lookupTable == null) { Global.Tracer.Assert(this.HasBeenTransferred, "Invalid LookupObjResult: PartitionID for LookupTable is empty."); OnDemandMetadata odpMetadata = odpContext.OdpMetadata; odpMetadata.EnsureLookupScalabilitySetup(odpContext.ChunkFactory, odpContext.GetActiveCompatibilityVersion(), odpContext.ProhibitSerializableValues); long treePartitionOffset = odpMetadata.LookupPartitionManager.GetTreePartitionOffset(this.m_lookupTablePartitionId); LookupScalabilityCache lookupScalabilityCache = odpMetadata.LookupScalabilityCache; this.m_lookupTable = (LookupTable)lookupScalabilityCache.Storage.Retrieve(treePartitionOffset); this.m_lookupTable.SetEqualityComparer(odpContext.ProcessingComparer); } return(this.m_lookupTable); }
public void TransferToLookupCache(OnDemandProcessingContext odpContext) { Global.Tracer.Assert(this.m_lookupTable != null, "Can't transfer a missing LookupTable"); Global.Tracer.Assert(!this.HasBeenTransferred, "Can't transfer a LookupTable twice"); OnDemandMetadata odpMetadata = odpContext.OdpMetadata; odpMetadata.EnsureLookupScalabilitySetup(odpContext.ChunkFactory, odpContext.GetActiveCompatibilityVersion(), odpContext.ProhibitSerializableValues); LookupScalabilityCache lookupScalabilityCache = odpMetadata.LookupScalabilityCache; IReference <LookupTable> reference = lookupScalabilityCache.AllocateEmptyTreePartition <LookupTable>(AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.LookupTableReference); this.m_lookupTable.TransferTo(lookupScalabilityCache); lookupScalabilityCache.SetTreePartitionContentsAndPin(reference, this.m_lookupTable); this.m_lookupTablePartitionId = reference.Id; reference.UnPinValue(); }