Пример #1
0
 protected IChunkReference <T> Merge(
     IChunkReference <T> left,
     IChunkReference <T> right,
     ChunkStack <T> chunkStack)
 {
     using (var chunkWriter = chunkStack.CreateChunkForMerge(left, right))
     {
         foreach (var value in _sortJoin.Join(left.GetValue(), right.GetValue()))
         {
             chunkWriter.Write(value);
         }
         return(chunkWriter.Complete());
     }
 }
Пример #2
0
            public IChunkReference <T> Merge(
                IChunkReference <T>[] chunks,
                ChunkStack <T> chunkStack)
            {
                using (var chunkWriter = chunkStack.CreateChunkForMerge(chunks))
                {
                    foreach (var value in _sortJoin.Join(chunks.Select(x => x.GetValue()).ToArray()))
                    {
                        chunkWriter.Write(value);
                    }

                    return(chunkWriter.Complete());
                }
            }