Add B+Tree Node and Leaf size fine tuning options.

This commit is contained in:
Ahmed Yasin Koculu
2023-06-17 01:33:49 +02:00
parent 04f5caaa30
commit 765f8b8f32
2 changed files with 19 additions and 2 deletions
+10
View File
@@ -99,6 +99,16 @@ public sealed class ZoneTreeOptions<TKey, TValue>
/// </summary>
public BTreeLockMode BTreeLockMode { get; set; } = BTreeLockMode.NodeLevelMonitor;
/// <summary>
/// The B+Tree node size.
/// </summary>
public int BTreeNodeSize { get; set; } = 128;
/// <summary>
/// The B+Tree leaf size.
/// </summary>
public int BTreeLeafSize { get; set; } = 128;
/// <summary>
/// ZoneTree Logger.
/// </summary>
@@ -54,7 +54,9 @@ public sealed class MutableSegment<TKey, TValue> : IMutableSegment<TKey, TValue>
BTree = new(Comparer,
Options.BTreeLockMode,
indexOpProvider);
indexOpProvider,
Options.BTreeNodeSize,
Options.BTreeLeafSize);
MarkValueDeleted = options.MarkValueDeleted;
MutableSegmentMaxItemCount = options.MutableSegmentMaxItemCount;
@@ -73,7 +75,12 @@ public sealed class MutableSegment<TKey, TValue> : IMutableSegment<TKey, TValue>
Options = options;
Comparer = options.Comparer;
BTree = new(Comparer, Options.BTreeLockMode);
BTree = new(
Comparer,
Options.BTreeLockMode,
null,
Options.BTreeNodeSize,
Options.BTreeLeafSize);
BTree.SetNextOpIndex(nextOpIndex);
MarkValueDeleted = options.MarkValueDeleted;