mirror of
https://github.com/ZoneTree/ZoneTree.git
synced 2026-10-29 05:21:33 +08:00
Add B+Tree Node and Leaf size fine tuning options.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user