Пример #1
0
        private static async Task RenderEmbeddedFixedSizeTreeAsync(FixedSizeTreeSafe.EmbeddedFixedSizeTreeSafe tree, TextWriter writer)
        {
            await writer.WriteLineAsync(string.Format("<p>Number of entries: {0:#,#;;0}, val size: {1:#,#;;0}.</p>", tree.NumberOfEntries, tree.ValueSize));

            await writer.WriteLineAsync("<ul>");

            foreach (var key in tree.GetKeys())
            {
                await writer.WriteLineAsync(string.Format("<li>{0:#,#;;0}</li>", key));
            }

            await writer.WriteLineAsync("</ul>");
        }
Пример #2
0
        private static unsafe Task DumpFixedSizeTreeToStreamAsync(LowLevelTransaction tx, FixedSizeTree fst, TextWriter writer, Slice name, Tree tree)
        {
            var ptr = tree.DirectRead(name);

            if (ptr == null)
            {
                return(RenderEmptyFixedSizeTreeAsync(writer));
            }

            if (((FixedSizeTreeHeader.Embedded *)ptr)->RootObjectType == RootObjectType.EmbeddedFixedSizeTree)
            {
                var embedded = new FixedSizeTreeSafe.EmbeddedFixedSizeTreeSafe(ptr);

                return(RenderEmbeddedFixedSizeTreeAsync(embedded, writer));
            }

            var large = new FixedSizeTreeSafe.LargeFixedSizeTreeSafe(ptr);

            return(RenderLargeFixedSizeTreeAsync(large, tx, fst, writer));
        }