Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ItemsPresenter.cs
- Pair.cs
- SrgsElement.cs
- streamingZipPartStream.cs
- ScriptResourceInfo.cs
- InternalBufferManager.cs
- InvokeMethodDesigner.xaml.cs
- CompiledXpathExpr.cs
- WeakHashtable.cs
- ApplicationHost.cs
- RenderTargetBitmap.cs
- TransformedBitmap.cs
- HtmlInputFile.cs
- Trustee.cs
- Win32SafeHandles.cs
- TcpClientSocketManager.cs
- ModelItemCollectionImpl.cs
- TreeNodeConverter.cs
- Sql8ExpressionRewriter.cs
- InvalidPipelineStoreException.cs
- OrthographicCamera.cs
- sqlnorm.cs
- GetLedgerRequest.cs
- CommandConverter.cs
- DateTimeFormat.cs
- Table.cs
- DataControlFieldCollection.cs
- DocumentGrid.cs
- Int64Storage.cs
- RuntimeResourceSet.cs
- DataGridLengthConverter.cs
- HeaderCollection.cs
- SafeLocalMemHandle.cs
- Transform3D.cs
- FontStretchConverter.cs
- UnitySerializationHolder.cs
- Ref.cs
- HTMLTagNameToTypeMapper.cs
- ScopedKnownTypes.cs
- DetailsViewCommandEventArgs.cs
- NonSerializedAttribute.cs
- StatementContext.cs
- EditorPartChrome.cs
- BitmapEffectState.cs
- CryptoProvider.cs
- XmlDataSourceView.cs
- UnauthorizedWebPart.cs
- ChannelManager.cs
- WsatConfiguration.cs
- ObjRef.cs
- EventPropertyMap.cs
- SoapExtensionStream.cs
- SingleAnimationUsingKeyFrames.cs
- ManagementInstaller.cs
- RadioButton.cs
- cookieexception.cs
- JsonDeserializer.cs
- RoleManagerSection.cs
- HtmlButton.cs
- EventWaitHandle.cs
- HttpHostedTransportConfiguration.cs
- Deflater.cs
- CompilerState.cs
- HtmlHead.cs
- DragEvent.cs
- CodeSnippetExpression.cs
- Int32KeyFrameCollection.cs
- Cursors.cs
- IdnElement.cs
- Vector3D.cs
- PointValueSerializer.cs
- MultiSelectRootGridEntry.cs
- DbModificationClause.cs
- ScriptControl.cs
- Boolean.cs
- SpeechAudioFormatInfo.cs
- ConfigPathUtility.cs
- BaseAsyncResult.cs
- X509CertificateEndpointIdentity.cs
- RequestQueue.cs
- WebPartDisplayMode.cs
- XmlDigitalSignatureProcessor.cs
- DetailsViewRowCollection.cs
- CurrentTimeZone.cs
- ObservableCollectionDefaultValueFactory.cs
- ToolboxBitmapAttribute.cs
- HttpFormatExtensions.cs
- NullableLongAverageAggregationOperator.cs
- ConfigUtil.cs
- SynchronizedDispatch.cs
- TablePatternIdentifiers.cs
- GreenMethods.cs
- LoginAutoFormat.cs
- InputProcessorProfiles.cs
- ListDictionary.cs
- CmsInterop.cs
- SqlServer2KCompatibilityAnnotation.cs
- XmlNotation.cs
- UrlPath.cs
- HtmlElementCollection.cs