static void DumpFile(string baseDir, int level, int version) { RazorCache cache = new RazorCache(); var tablefile = new SortedBlockTable(cache, baseDir, level, version); try { tablefile.DumpContents(msg => Console.WriteLine(msg)); } finally { tablefile.Close(); } }
public void WriteAndDumpSBT() { string path = Path.GetFullPath("TestData\\DumpPrefixedSBT"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } var mt = new MemTable(); for (int i = 0; i < 10000; i++) { var k0 = Key.Random(40); var v0 = Value.Random(200); mt.Add(k0, v0); } mt.WriteToSortedBlockTable("TestData\\DumpPrefixedSBT", 0, 10); var cache = new RazorCache(); var sbt = new SortedBlockTable(cache, "TestData\\DumpPrefixedSBT", 0, 10); sbt.DumpContents((msg) => Console.WriteLine(msg)); }
public void WriteAndDumpSBT() { string path = Path.GetFullPath("TestData\\DumpPrefixedSBT"); if (!Directory.Exists(path)) Directory.CreateDirectory(path); var mt = new MemTable(); for (int i = 0; i < 10000; i++) { var k0 = Key.Random(40); var v0 = Value.Random(200); mt.Add(k0, v0); } mt.WriteToSortedBlockTable("TestData\\DumpPrefixedSBT", 0, 10); var cache = new RazorCache(); var sbt = new SortedBlockTable(cache, "TestData\\DumpPrefixedSBT", 0, 10); sbt.DumpContents((msg) => Console.WriteLine(msg)); }