Пример #1
0
        private void StoreAggregationResult(TreePage page, Table table, AggregationResult result)
        {
            using (_treeReductionStats.StoringReduceResult.Start())
            {
                var pageNumber      = Bits.SwapBytes(page.PageNumber);
                var numberOfOutputs = result.Count;

                using (table.Allocate(out TableValueBuilder tvb))
                {
                    tvb.Add(pageNumber);
                    tvb.Add(page.NumberOfEntries);
                    tvb.Add(numberOfOutputs);

                    foreach (var output in result.GetOutputsToStore())
                    {
                        tvb.Add(output.BasePointer, output.Size);
                    }

                    table.Set(tvb);
                }
            }
        }
Пример #2
0
        private void StoreAggregationResult(long modifiedPage, int aggregatedEntries, Table table, AggregationResult result, IndexingStatsScope stats)
        {
            using (_treeReductionStats.StoringReduceResult.Start())
            {
                var pageNumber      = Bits.SwapBytes(modifiedPage);
                var numberOfOutputs = result.Count;

                var tvb = new TableValueBuilder
                {
                    pageNumber,
                    aggregatedEntries,
                    numberOfOutputs
                };

                foreach (var output in result.GetOutputsToStore())
                {
                    tvb.Add(output.BasePointer, output.Size);
                }

                table.Set(tvb);
            }
        }