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
- TraceContextEventArgs.cs
- DupHandleConnectionReader.cs
- LabelInfo.cs
- EffectiveValueEntry.cs
- PromptBuilder.cs
- StateChangeEvent.cs
- CodeDelegateInvokeExpression.cs
- MruCache.cs
- XmlEnumAttribute.cs
- KeyTime.cs
- Root.cs
- RectangleConverter.cs
- DateTimeUtil.cs
- Annotation.cs
- ThemeDictionaryExtension.cs
- GenerateTemporaryTargetAssembly.cs
- XamlTypeMapper.cs
- SocketException.cs
- PageThemeBuildProvider.cs
- OdbcConnection.cs
- ContractUtils.cs
- AspCompat.cs
- SecurityElement.cs
- Subset.cs
- FlowNode.cs
- PrimitiveSchema.cs
- WindowsIPAddress.cs
- SmiEventSink.cs
- Lease.cs
- ReferenceTypeElement.cs
- ArcSegment.cs
- DummyDataSource.cs
- XmlSchemaElement.cs
- BitStack.cs
- HttpListenerPrefixCollection.cs
- MutexSecurity.cs
- Int32CAMarshaler.cs
- ContentTextAutomationPeer.cs
- EntityDataSource.cs
- ChannelBinding.cs
- DecoderReplacementFallback.cs
- ListItemCollection.cs
- DecoderExceptionFallback.cs
- OrderByBuilder.cs
- CharConverter.cs
- ImageButton.cs
- ViewValidator.cs
- translator.cs
- AvTrace.cs
- PhonemeConverter.cs
- IncrementalCompileAnalyzer.cs
- PropertyPathWorker.cs
- XmlSchemaFacet.cs
- XappLauncher.cs
- xmlfixedPageInfo.cs
- CompositeDataBoundControl.cs
- DefaultParameterValueAttribute.cs
- TraceFilter.cs
- InternalControlCollection.cs
- SqlDataSourceSelectingEventArgs.cs
- ListChangedEventArgs.cs
- DrawingBrush.cs
- DefaultTraceListener.cs
- ThreadAttributes.cs
- Attributes.cs
- BrowserTree.cs
- SubpageParaClient.cs
- SqlProfileProvider.cs
- UrlAuthFailedErrorFormatter.cs
- WhitespaceRuleReader.cs
- PropertyKey.cs
- SecurityIdentifierElementCollection.cs
- MemberInfoSerializationHolder.cs
- WebServiceData.cs
- Compilation.cs
- PagedDataSource.cs
- SystemDropShadowChrome.cs
- OracleSqlParser.cs
- WpfPayload.cs
- ProfilePropertySettings.cs
- PathSegment.cs
- iisPickupDirectory.cs
- XmlComment.cs
- XmlSchemaAttribute.cs
- ScriptRef.cs
- Events.cs
- CodeCatchClauseCollection.cs
- WindowsPrincipal.cs
- FieldAccessException.cs
- COM2Enum.cs
- FunctionImportMapping.cs
- ArrayElementGridEntry.cs
- FlowchartStart.xaml.cs
- ActivityTypeCodeDomSerializer.cs
- RestClientProxyHandler.cs
- BamlBinaryWriter.cs
- RemotingServices.cs
- mediaclock.cs
- StorageRoot.cs
- XmlDataDocument.cs