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
- IdnElement.cs
- WebPartConnectionCollection.cs
- BrowserTree.cs
- VisualBrush.cs
- ToolStripDropDownClosedEventArgs.cs
- ViewStateModeByIdAttribute.cs
- MarkupProperty.cs
- UpdateProgress.cs
- RowToParametersTransformer.cs
- MessageDesigner.cs
- ListControlConvertEventArgs.cs
- ThreadPool.cs
- Rotation3DAnimationBase.cs
- UriTemplate.cs
- SHA512.cs
- FormViewDeleteEventArgs.cs
- PropertyChangingEventArgs.cs
- DecoderBestFitFallback.cs
- _LocalDataStoreMgr.cs
- DateTimeConstantAttribute.cs
- ConditionalAttribute.cs
- SettingsBase.cs
- Environment.cs
- ClientTargetCollection.cs
- BinHexDecoder.cs
- WebServiceHostFactory.cs
- safesecurityhelperavalon.cs
- LogArchiveSnapshot.cs
- DrawingState.cs
- MetafileHeader.cs
- SrgsElement.cs
- PnrpPermission.cs
- Config.cs
- BulletedListEventArgs.cs
- SoapInteropTypes.cs
- ManagementObjectSearcher.cs
- Trace.cs
- UrlPath.cs
- DelegateSerializationHolder.cs
- HtmlTableCellCollection.cs
- iisPickupDirectory.cs
- ControlPaint.cs
- UnsafeNativeMethods.cs
- TrimSurroundingWhitespaceAttribute.cs
- WindowsEditBoxRange.cs
- Polygon.cs
- AxImporter.cs
- ToolStripPanelCell.cs
- HostProtectionException.cs
- MTConfigUtil.cs
- counter.cs
- ReferencedType.cs
- LogicalChannel.cs
- DrawingContextWalker.cs
- ProcessStartInfo.cs
- PasswordBoxAutomationPeer.cs
- ValueQuery.cs
- MenuItemAutomationPeer.cs
- Accessible.cs
- TableLayoutPanel.cs
- SQLSingle.cs
- EntitySetDataBindingList.cs
- MethodRental.cs
- ObjectDataSourceSelectingEventArgs.cs
- ObjectDataSourceDesigner.cs
- GrammarBuilderPhrase.cs
- TreeViewItemAutomationPeer.cs
- EmissiveMaterial.cs
- ToolStripSystemRenderer.cs
- Convert.cs
- NetDataContractSerializer.cs
- View.cs
- DecimalConverter.cs
- ButtonChrome.cs
- XPathDocumentNavigator.cs
- SHA1.cs
- SessionKeyExpiredException.cs
- CompilerInfo.cs
- LazyTextWriterCreator.cs
- DeviceContext.cs
- HelloMessageApril2005.cs
- HttpModulesSection.cs
- EditorPartCollection.cs
- ListViewUpdateEventArgs.cs
- DbMetaDataFactory.cs
- Control.cs
- ObjectSet.cs
- SystemColors.cs
- MouseEventArgs.cs
- AttachedPropertyBrowsableAttribute.cs
- regiisutil.cs
- OdbcConnectionFactory.cs
- TextServicesLoader.cs
- DiagnosticsElement.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ThreadExceptionEvent.cs
- WindowsTab.cs
- WS2007FederationHttpBindingElement.cs
- FtpWebRequest.cs
- TypeForwardedToAttribute.cs