public void DisposePersistedTreeScalability() { if (this.m_groupTreeScalabilityCache != null) { this.m_groupTreeScalabilityCache.Dispose(); this.m_groupTreeScalabilityCache = null; } if (this.m_lookupScalabilityCache != null) { this.m_lookupScalabilityCache.Dispose(); this.m_lookupScalabilityCache = null; } }
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(); }
public void SerializeSnapshot() { Global.Tracer.Assert(null != this.m_odpContext, "OnDemandProcessingContext is unavailable"); OnDemandMetadata odpMetadata = this.m_odpContext.OdpMetadata; if (odpMetadata.SnapshotHasChanged) { try { IReference <ReportInstance> reportInstance = odpMetadata.ReportInstance; Global.Tracer.Assert(reportInstance != null, "Missing GroupTreeRoot"); if (odpMetadata.IsInitialProcessingRequest) { reportInstance.UnPinValue(); } if (odpMetadata.GroupTreeHasChanged || odpMetadata.IsInitialProcessingRequest) { GroupTreeScalabilityCache groupTreeScalabilityCache = this.m_odpContext.OdpMetadata.GroupTreeScalabilityCache; groupTreeScalabilityCache.Flush(); if (odpMetadata.IsInitialProcessingRequest) { GroupTreePartition groupTreePartition = new GroupTreePartition(); groupTreePartition.AddTopLevelScopeInstance((IReference <ScopeInstance>)reportInstance); long groupTreeRootOffset = groupTreeScalabilityCache.Storage.Allocate(groupTreePartition); groupTreeScalabilityCache.Storage.Flush(); odpMetadata.GroupTreeRootOffset = groupTreeRootOffset; } } if (odpMetadata.LookupInfoHasChanged) { LookupScalabilityCache lookupScalabilityCache = this.m_odpContext.OdpMetadata.LookupScalabilityCache; lookupScalabilityCache.Flush(); } OnDemandProcessingManager.SerializeMetadata(this.m_odpContext.ChunkFactory, this.m_odpContext.OdpMetadata, this.m_odpContext.GetActiveCompatibilityVersion(), this.m_odpContext.ProhibitSerializableValues); OnDemandProcessingManager.SerializeSortFilterEventInfo(this.m_odpContext); } finally { if (odpMetadata != null) { odpMetadata.DisposePersistedTreeScalability(); } } } }