Ejemplo n.º 1
0
        public async Task CreateColumnSegment(VectorNode column, Stream vectorStream)
        {
            var time = Stopwatch.StartNew();

            await _postingsWriter.Write(column);

            var page = VectorNodeWriter.SerializeTree(column, _ixStream, vectorStream);

            _ixStream.Flush();
            _ixPageIndexWriter.Write(page.offset, page.length);
            _ixPageIndexWriter.Flush();

            var size = VectorNodeReader.Size(column);

            this.Log("serialized column {0} in {1}. weight {2} depth {3} width {4} (avg depth {5})",
                     _keyId, time.Elapsed, column.Weight, size.depth, size.width, size.avgDepth);
        }
Ejemplo n.º 2
0
        public void Concat(VectorNode rootNode)
        {
            var offsets = new Dictionary <long, IList <long> >();
            var all     = VectorNodeReader.All(rootNode);

            foreach (var node in all)
            {
                if (node.PostingsOffsets != null && node.PostingsOffsets.Count > 1)
                {
                    offsets.Add(node.PostingsOffset, node.PostingsOffsets);
                }
            }

            if (offsets.Count == 0)
            {
                return;
            }

            Concat(offsets);
        }