Calculates default node-threasholds based upon the average number of bytes in key and value
Syntax
Parameters
- avgKeySizeBytes
- avgValueSizeBytes
Example
BPlusTree/BPlusTree.Test/TestBulkInsert.cs
C# | Copy Code |
---|
BPlusTreeOptions<int, string> options = Options;
using (TempFile temp = new TempFile())
{
temp.Delete();
options.CreateFile = CreatePolicy.Always;
options.FileName = temp.TempPath;
options.CalcBTreeOrder(4, 4);
Stopwatch sw = Stopwatch.StartNew();
Dictionary<int, string> expected =
TestMergeRandom(options, 2, 300);
Trace.TraceInformation("Creating {0} nodes in {1}.", expected.Count, sw.Elapsed);
sw = Stopwatch.StartNew();
options = Options;
options.CreateFile = CreatePolicy.Never;
options.FileName = temp.TempPath;
options.CalcBTreeOrder(4, 4);
using (BPlusTree<int, string> tree = new BPlusTree<int, string>(options))
{
VerifyDictionary(expected, tree);
}
Trace.TraceInformation("Verified {0} nodes in {1}.", expected.Count, sw.Elapsed);
} |
VB.NET | Copy Code |
---|
Dim options As BPlusTreeOptions(Of Integer, String) = Options
Using temp As New TempFile()
temp.Delete()
options.CreateFile = CreatePolicy.Always
options.FileName = temp.TempPath
options.CalcBTreeOrder(4, 4)
Dim sw As Stopwatch = Stopwatch.StartNew()
Dim expected As Dictionary(Of Integer, String) = TestMergeRandom(options, 2, 300)
Trace.TraceInformation("Creating {0} nodes in {1}.", expected.Count, sw.Elapsed)
sw = Stopwatch.StartNew()
options = Options
options.CreateFile = CreatePolicy.Never
options.FileName = temp.TempPath
options.CalcBTreeOrder(4, 4)
Using tree As New BPlusTree(Of Integer, String)(options)
VerifyDictionary(expected, tree)
End Using
Trace.TraceInformation("Verified {0} nodes in {1}.", expected.Count, sw.Elapsed)
End Using |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also