private void UnPinContainingBucket(int index) { if (m_array != null) { m_array.UnPinValue(); return; } int bucketIndex = GetBucketIndex(index); m_buckets[bucketIndex].UnPinValue(); m_buckets.UnPinContainingBucket(bucketIndex); }
internal override void CreateCell(RuntimeCells cellsCollection, int collectionKey, Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode outerGroupingMember, Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode innerGroupingMember, Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef) { RuntimeCell runtimeCell = new RuntimeChartCriCell((RuntimeChartCriGroupLeafObjReference)m_selfReference, outerGroupingMember, innerGroupingMember, !m_hasInnerHierarchy); if (runtimeCell.SelfReference == null) { cellsCollection.AddCell(collectionKey, runtimeCell); return; } IReference <RuntimeCell> selfReference = runtimeCell.SelfReference; selfReference.UnPinValue(); cellsCollection.AddCell(collectionKey, selfReference); }
public void ProcessUserSortForTarget(ObjectModelImpl reportObjectModel, AspNetCore.ReportingServices.RdlExpressions.ReportRuntime reportRuntime, IReference <IHierarchyObj> target, ref ScalableList <DataFieldRow> dataRows, bool targetForNonDetailSort) { using (target.PinValue()) { IHierarchyObj hierarchyObj = target.Value(); if (targetForNonDetailSort && dataRows != null && 0 < dataRows.Count) { IReference <RuntimeSortFilterEventInfo> reference = null; try { List <int> sortFilterInfoIndices = hierarchyObj.SortFilterInfoIndices; Global.Tracer.Assert(null != hierarchyObj.SortTree, "(null != targetObj.SortTree)"); if (sortFilterInfoIndices != null) { reference = this.m_runtimeSortFilterInfo[sortFilterInfoIndices[0]]; } RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = null; if (reference != null) { reference.PinValue(); runtimeSortFilterEventInfo = reference.Value(); } for (int i = 0; i < dataRows.Count; i++) { dataRows[i].SetFields(reportObjectModel.FieldsImpl); object keyValue = DBNull.Value; if (runtimeSortFilterEventInfo != null) { keyValue = runtimeSortFilterEventInfo.GetSortOrder(reportRuntime); } hierarchyObj.SortTree.NextRow(keyValue, hierarchyObj); } } finally { if (reference != null) { reference.UnPinValue(); } } if (dataRows != null) { dataRows.Dispose(); } dataRows = null; } hierarchyObj.MarkSortInfoProcessed(this.m_runtimeSortFilterInfo); } }
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 override void CreateCell(RuntimeCells cellsCollection, int collectionKey, AspNetCore.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode outerGroupingMember, AspNetCore.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode innerGroupingMember, AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef) { RuntimeCell runtimeCell = new RuntimeChartCriCell((RuntimeChartCriGroupLeafObjReference)base.m_selfReference, outerGroupingMember, innerGroupingMember, !base.m_hasInnerHierarchy); if ((BaseReference)runtimeCell.SelfReference == (object)null) { cellsCollection.AddCell(collectionKey, runtimeCell); } else { IReference <RuntimeCell> selfReference = runtimeCell.SelfReference; selfReference.UnPinValue(); cellsCollection.AddCell(collectionKey, selfReference); } }
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(); } } } }
public void UnPinAll() { if (this.m_bucketPinState == BucketPinState.UntilListEnd) { if (this.m_array != null) { this.m_array.UnPinValue(); } if (this.m_buckets != null) { for (int i = 0; i < this.m_buckets.Count; i++) { this.m_buckets[i].UnPinValue(); } this.m_buckets.UnPinAll(); } } else if (this.m_bucketPinState == BucketPinState.UntilBucketFull) { if (this.m_count < Math.Max(this.m_capacity, this.m_bucketSize)) { if (this.m_array != null) { this.m_array.UnPinValue(); } else { int bucketIndex = this.GetBucketIndex(this.m_count - 1); IReference <StorableArray> reference = this.m_buckets[bucketIndex]; reference.UnPinValue(); this.m_buckets.UnPinContainingBucket(bucketIndex); } } if (this.m_buckets != null) { this.m_buckets.UnPinAll(); } } }
internal override void NextRow(object keyValue, bool hasParent, object parentKey) { IReference <RuntimeHierarchyObj> value = null; try { m_hashtable.TryGetValue(keyValue, out value); } catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError) { throw new ReportProcessingException(m_owner.RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError.Type)); } catch (ReportProcessingException_ComparisonError e) { throw new ReportProcessingException(m_owner.RegisterComparisonError("GroupExpression", e)); } if (value != null) { using (value.PinValue()) { value.Value().NextRow(); } return; } RuntimeHierarchyObj runtimeHierarchyObj = new RuntimeHierarchyObj(m_owner, m_objectType, ((IScope)m_owner).Depth + 1); value = (IReference <RuntimeHierarchyObj>)runtimeHierarchyObj.SelfReference; try { m_hashtable.Add(keyValue, value); runtimeHierarchyObj = value.Value(); runtimeHierarchyObj.NextRow(); if (hasParent) { IReference <RuntimeHierarchyObj> value2 = null; IReference <RuntimeGroupLeafObj> reference = null; try { m_hashtable.TryGetValue(parentKey, out value2); } catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError2) { throw new ReportProcessingException(m_owner.RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError2.Type)); } catch (ReportProcessingException_ComparisonError e2) { throw new ReportProcessingException(m_owner.RegisterComparisonError("Parent", e2)); } if (value2 != null) { RuntimeHierarchyObj runtimeHierarchyObj2 = value2.Value(); Global.Tracer.Assert(runtimeHierarchyObj2.HierarchyObjs != null, "(null != parentHierarchyObj.HierarchyObjs)"); reference = (RuntimeGroupLeafObjReference)runtimeHierarchyObj2.HierarchyObjs[0]; } Global.Tracer.Assert(runtimeHierarchyObj.HierarchyObjs != null, "(null != hierarchyObj.HierarchyObjs)"); RuntimeGroupLeafObjReference runtimeGroupLeafObjReference = (RuntimeGroupLeafObjReference)runtimeHierarchyObj.HierarchyObjs[0]; bool addToWaitList = true; if (reference == runtimeGroupLeafObjReference) { reference = null; addToWaitList = false; } ProcessChildren(keyValue, reference, runtimeGroupLeafObjReference); ProcessParent(parentKey, reference, runtimeGroupLeafObjReference, addToWaitList); } } finally { value.UnPinValue(); } }
private void FinishFilters(AggregateUpdateContext context) { if (m_filterInfo == null) { return; } FilterInfo filterInfo = m_filterInfo; m_filterInfo = null; m_startFilterIndex = m_currentSpecialFilterIndex + 1; bool flag = m_startFilterIndex >= m_filters.Count; TrimInstanceSet(filterInfo); IEnumerator <object> instances = filterInfo.Instances; if (instances != null) { try { Microsoft.ReportingServices.ReportProcessing.ReportProcessing.IFilterOwner filterOwner; if (m_owner != null) { m_owner.PinValue(); filterOwner = m_owner.Value(); } else { filterOwner = m_ownerObj; } while (instances.MoveNext()) { object current = instances.Current; if (FilterTypes.GroupFilter == m_filterType) { IReference <RuntimeGroupLeafObj> reference = (IReference <RuntimeGroupLeafObj>)current; using (reference.PinValue()) { RuntimeGroupLeafObj runtimeGroupLeafObj = reference.Value(); runtimeGroupLeafObj.SetupEnvironment(); if (flag || PassFilters(current)) { runtimeGroupLeafObj.PostFilterNextRow(context); } else { runtimeGroupLeafObj.FailFilter(); } } } else { ((DataFieldRow)current).SetFields(m_processingContext.ReportObjectModel.FieldsImpl); if (flag || PassFilters(current)) { filterOwner.PostFilterNextRow(); } } } } finally { if (m_owner != null) { m_owner.UnPinValue(); } } } filterInfo.RemoveAll(); filterInfo = null; FinishFilters(context); }