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
- SymbolMethod.cs
- DataComponentMethodGenerator.cs
- Decorator.cs
- EditorPartChrome.cs
- DrawingCollection.cs
- TabletDeviceInfo.cs
- FixedPage.cs
- PrePostDescendentsWalker.cs
- ServiceParser.cs
- NativeCompoundFileAPIs.cs
- LongCountAggregationOperator.cs
- StringKeyFrameCollection.cs
- BooleanExpr.cs
- NonParentingControl.cs
- SchemaNamespaceManager.cs
- ExtenderProvidedPropertyAttribute.cs
- InternalBase.cs
- ValidatorCollection.cs
- HierarchicalDataBoundControl.cs
- MdbDataFileEditor.cs
- ThreadExceptionDialog.cs
- SubstitutionDesigner.cs
- DataGridViewTopRowAccessibleObject.cs
- NetDataContractSerializer.cs
- VectorKeyFrameCollection.cs
- ParserExtension.cs
- DispatchChannelSink.cs
- DrawingGroup.cs
- Boolean.cs
- StringResourceManager.cs
- NumericUpDownAcceleration.cs
- mansign.cs
- WebHeaderCollection.cs
- DynamicValidator.cs
- TreeNodeCollection.cs
- Ticks.cs
- FixedBufferAttribute.cs
- CssClassPropertyAttribute.cs
- Panel.cs
- HexParser.cs
- GroupQuery.cs
- PackWebRequest.cs
- GeneralTransform3DTo2D.cs
- IISUnsafeMethods.cs
- Identifier.cs
- CheckBoxField.cs
- VariableExpressionConverter.cs
- SqlBulkCopyColumnMappingCollection.cs
- XmlElementList.cs
- WebPartCatalogAddVerb.cs
- FormViewDeleteEventArgs.cs
- VisualBasic.cs
- IODescriptionAttribute.cs
- OrCondition.cs
- ControlAdapter.cs
- TdsParserStaticMethods.cs
- DrawingAttributes.cs
- BrowserCapabilitiesFactory.cs
- LineMetrics.cs
- ObjectReferenceStack.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- Path.cs
- DesignerToolStripControlHost.cs
- DBNull.cs
- Version.cs
- EpmSourcePathSegment.cs
- SafeNativeMethodsMilCoreApi.cs
- UxThemeWrapper.cs
- CssStyleCollection.cs
- LayoutEditorPart.cs
- OracleCommand.cs
- ACL.cs
- _AutoWebProxyScriptEngine.cs
- XmlUtf8RawTextWriter.cs
- ProgressBarRenderer.cs
- BitmapSizeOptions.cs
- Button.cs
- ToolStripSplitButton.cs
- ApplicationGesture.cs
- XslVisitor.cs
- ToolStripButton.cs
- ComponentDispatcher.cs
- Pair.cs
- ChangePasswordAutoFormat.cs
- ControlParameter.cs
- ListCollectionView.cs
- FrameworkContentElement.cs
- PresentationSource.cs
- FileChangesMonitor.cs
- Int32.cs
- XmlElementCollection.cs
- ListViewAutomationPeer.cs
- DataListGeneralPage.cs
- ProcessModelSection.cs
- TableAdapterManagerMethodGenerator.cs
- _FtpDataStream.cs
- NamespaceInfo.cs
- ApplyTemplatesAction.cs
- DecoderReplacementFallback.cs
- ValueUtilsSmi.cs