Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Linq / Parallel / QueryOperators / PartitionedStreamMerger.cs / 1305376 / PartitionedStreamMerger.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // PartitionedStreamMerger.cs // //[....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Threading.Tasks; using System.Diagnostics.Contracts; namespace System.Linq.Parallel { ////// Partitioned stream recipient that will merge the results. /// internal class PartitionedStreamMerger: IPartitionedStreamRecipient { private bool m_forEffectMerge; private ParallelMergeOptions m_mergeOptions; private bool m_isOrdered; private MergeExecutor m_mergeExecutor = null; private TaskScheduler m_taskScheduler; private int m_queryId; // ID of the current query execution private CancellationState m_cancellationState; #if DEBUG private bool m_received = false; #endif // Returns the merge executor which merges the received partitioned stream. internal MergeExecutor MergeExecutor { get { #if DEBUG Contract.Assert(m_received, "Cannot return the merge executor because Receive() has not been called yet."); #endif return m_mergeExecutor; } } internal PartitionedStreamMerger(bool forEffectMerge, ParallelMergeOptions mergeOptions, TaskScheduler taskScheduler, bool outputOrdered, CancellationState cancellationState, int queryId) { m_forEffectMerge = forEffectMerge; m_mergeOptions = mergeOptions; m_isOrdered = outputOrdered; m_taskScheduler = taskScheduler; m_cancellationState = cancellationState; m_queryId = queryId; } public void Receive (PartitionedStream partitionedStream) { #if DEBUG m_received = true; #endif m_mergeExecutor = MergeExecutor .Execute ( partitionedStream, m_forEffectMerge, m_mergeOptions, m_taskScheduler, m_isOrdered, m_cancellationState, m_queryId); TraceHelpers.TraceInfo("[timing]: {0}: finished opening - QueryOperator<>::GetEnumerator", DateTime.Now.Ticks); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // PartitionedStreamMerger.cs // // [....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Threading.Tasks; using System.Diagnostics.Contracts; namespace System.Linq.Parallel { ////// Partitioned stream recipient that will merge the results. /// internal class PartitionedStreamMerger: IPartitionedStreamRecipient { private bool m_forEffectMerge; private ParallelMergeOptions m_mergeOptions; private bool m_isOrdered; private MergeExecutor m_mergeExecutor = null; private TaskScheduler m_taskScheduler; private int m_queryId; // ID of the current query execution private CancellationState m_cancellationState; #if DEBUG private bool m_received = false; #endif // Returns the merge executor which merges the received partitioned stream. internal MergeExecutor MergeExecutor { get { #if DEBUG Contract.Assert(m_received, "Cannot return the merge executor because Receive() has not been called yet."); #endif return m_mergeExecutor; } } internal PartitionedStreamMerger(bool forEffectMerge, ParallelMergeOptions mergeOptions, TaskScheduler taskScheduler, bool outputOrdered, CancellationState cancellationState, int queryId) { m_forEffectMerge = forEffectMerge; m_mergeOptions = mergeOptions; m_isOrdered = outputOrdered; m_taskScheduler = taskScheduler; m_cancellationState = cancellationState; m_queryId = queryId; } public void Receive (PartitionedStream partitionedStream) { #if DEBUG m_received = true; #endif m_mergeExecutor = MergeExecutor .Execute ( partitionedStream, m_forEffectMerge, m_mergeOptions, m_taskScheduler, m_isOrdered, m_cancellationState, m_queryId); TraceHelpers.TraceInfo("[timing]: {0}: finished opening - QueryOperator<>::GetEnumerator", DateTime.Now.Ticks); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- VariableReference.cs
- CacheChildrenQuery.cs
- SolidBrush.cs
- WebReferencesBuildProvider.cs
- precedingquery.cs
- DiagnosticsConfiguration.cs
- EventWaitHandleSecurity.cs
- DecimalAnimationBase.cs
- SqlConnectionPoolGroupProviderInfo.cs
- MulticastNotSupportedException.cs
- PatternMatcher.cs
- DataGridPreparingCellForEditEventArgs.cs
- AttributeUsageAttribute.cs
- RNGCryptoServiceProvider.cs
- AtomMaterializer.cs
- SafeTimerHandle.cs
- DoubleAnimationBase.cs
- DictionarySectionHandler.cs
- XmlAnyElementAttribute.cs
- DocumentApplication.cs
- ServiceParser.cs
- GlyphingCache.cs
- SmtpSection.cs
- DiscoveryViaBehavior.cs
- ContentPlaceHolder.cs
- FocusWithinProperty.cs
- InvalidateEvent.cs
- XamlFigureLengthSerializer.cs
- DependencyPropertyChangedEventArgs.cs
- DesignerUtility.cs
- BinaryFormatter.cs
- NodeLabelEditEvent.cs
- CacheDependency.cs
- VersionValidator.cs
- EpmCustomContentWriterNodeData.cs
- NameValueConfigurationCollection.cs
- CustomGrammar.cs
- SQLInt64Storage.cs
- SecurityTokenAttachmentMode.cs
- CompensationExtension.cs
- future.cs
- DataTableMapping.cs
- HtmlProps.cs
- ApplicationGesture.cs
- DefaultObjectMappingItemCollection.cs
- SHA1.cs
- ADConnectionHelper.cs
- TraceUtils.cs
- RuleInfoComparer.cs
- HierarchicalDataSourceConverter.cs
- PipeSecurity.cs
- DesignerVerbCollection.cs
- CodeAttributeDeclaration.cs
- StatusBarPanel.cs
- ElementMarkupObject.cs
- ConnectionStringsExpressionBuilder.cs
- ComUdtElementCollection.cs
- StyleHelper.cs
- TextRangeProviderWrapper.cs
- MachineKeyConverter.cs
- ActiveDocumentEvent.cs
- CodeDesigner.cs
- PreservationFileReader.cs
- DragStartedEventArgs.cs
- HttpValueCollection.cs
- Brush.cs
- TraceUtility.cs
- ListBindingConverter.cs
- HitTestParameters3D.cs
- ProfileSettingsCollection.cs
- DetailsViewModeEventArgs.cs
- SqlTypeSystemProvider.cs
- Header.cs
- StatusBarPanelClickEvent.cs
- XmlTextReader.cs
- FormViewRow.cs
- ColumnResult.cs
- NewItemsContextMenuStrip.cs
- NameSpaceExtractor.cs
- TypographyProperties.cs
- DataGridViewRowPrePaintEventArgs.cs
- Animatable.cs
- SafeThemeHandle.cs
- TaiwanCalendar.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- InertiaTranslationBehavior.cs
- RequestStatusBarUpdateEventArgs.cs
- PenContexts.cs
- InvalidEnumArgumentException.cs
- smtppermission.cs
- DriveInfo.cs
- FillRuleValidation.cs
- DataGridViewImageColumn.cs
- SR.Designer.cs
- Expression.cs
- NetMsmqSecurityElement.cs
- CodeArgumentReferenceExpression.cs
- TemplateBindingExpressionConverter.cs
- Int16AnimationUsingKeyFrames.cs
- StaticFileHandler.cs