internal override void GivePartitionedStream(IPartitionedStreamRecipient <TOutput> recipient) { Debug.Assert(IsIndexible == (_op.OrdinalIndexState == OrdinalIndexState.Indexable)); Debug.Assert(_settings.ExecutionMode != null); if (_settings.ExecutionMode.Value == ParallelExecutionMode.Default && _op.LimitsParallelism) { Debug.Assert(_settings.DegreeOfParallelism != null); // We need to run the query sequentially up to and including this operator IEnumerable <TOutput> opSequential = _op.AsSequentialQuery(_settings.CancellationState.ExternalCancellationToken); PartitionedStream <TOutput, int> result = ExchangeUtilities.PartitionDataSource( opSequential, _settings.DegreeOfParallelism.Value, _preferStriping); recipient.Receive <int>(result); } else if (IsIndexible) { Debug.Assert(_settings.DegreeOfParallelism != null); // The output of this operator is indexable. Pass the partitioned output into the IPartitionedStreamRecipient. PartitionedStream <TOutput, int> result = ExchangeUtilities.PartitionDataSource(this, _settings.DegreeOfParallelism.Value, _preferStriping); recipient.Receive <int>(result); } else { // The common case: get partitions from the child and wrap each partition. _leftChildQueryResults.GivePartitionedStream(new LeftChildResultsRecipient(recipient, this, _preferStriping, _settings)); } }
internal override void GivePartitionedStream(IPartitionedStreamRecipient <TElement> recipient) { // Since we are not using _data as an IList, we can pass useStriping = false. PartitionedStream <TElement, int> partitionedStream = ExchangeUtilities.PartitionDataSource( _data, _settings.DegreeOfParallelism.Value, false); recipient.Receive <int>(partitionedStream); }
internal override void GivePartitionedStream(IPartitionedStreamRecipient <TOutput> recipient) { if ((((ParallelExecutionMode)this.m_settings.ExecutionMode.Value) == ParallelExecutionMode.Default) && this.m_op.LimitsParallelism) { IEnumerable <TOutput> source = this.m_op.AsSequentialQuery(this.m_settings.CancellationState.ExternalCancellationToken); PartitionedStream <TOutput, int> partitionedStream = ExchangeUtilities.PartitionDataSource <TOutput>(source, this.m_settings.DegreeOfParallelism.Value, this.m_preferStriping); recipient.Receive <int>(partitionedStream); } else if (this.IsIndexible) { PartitionedStream <TOutput, int> stream2 = ExchangeUtilities.PartitionDataSource <TOutput>(this, this.m_settings.DegreeOfParallelism.Value, this.m_preferStriping); recipient.Receive <int>(stream2); } else { this.m_childQueryResults.GivePartitionedStream(new ChildResultsRecipient <TInput, TOutput>(recipient, this.m_op, this.m_preferStriping, this.m_settings)); } }
internal PartitionedStream <T, int> GetPartitionedStream() { return(ExchangeUtilities.PartitionDataSource(m_source, m_partitionCount, m_useStriping)); }
internal override void GivePartitionedStream(IPartitionedStreamRecipient <TOutput> recipient) { PartitionedStream <TOutput, int> partitionedStream = ExchangeUtilities.PartitionDataSource(this, _partitionCount, _preferStriping); recipient.Receive(partitionedStream); }
internal override void GivePartitionedStream(IPartitionedStreamRecipient <TElement> recipient) { PartitionedStream <TElement, int> partitionedStream = ExchangeUtilities.PartitionDataSource <TElement>(this.m_data, this.m_settings.DegreeOfParallelism.Value, false); recipient.Receive <int>(partitionedStream); }