Class ZoneTreeMaintainer<TKey, TValue>
The maintainer for ZoneTree to control merge operations and memory compaction.
Inherited Members
Namespace: Tenray.ZoneTree.Core
Assembly: ZoneTree.dll
Syntax
public sealed class ZoneTreeMaintainer<TKey, TValue> : IMaintainer, IDisposable
Type Parameters
Name | Description |
---|---|
TKey | The key type |
TValue | The value type |
Remarks
You must complete or cancel all pending tasks of this maintainer before disposing.
Constructors
| Improve this Doc View SourceZoneTreeMaintainer(ITransactionalZoneTree<TKey, TValue>, ILogger)
Creates a ZoneTreeMaintainer.
Declaration
public ZoneTreeMaintainer(ITransactionalZoneTree<TKey, TValue> zoneTree, ILogger logger = null)
Parameters
Type | Name | Description |
---|---|---|
ITransactionalZoneTree<TKey, TValue> | zoneTree | The transactional ZoneTree |
ILogger | logger | The logger |
ZoneTreeMaintainer(IZoneTree<TKey, TValue>, bool, ILogger)
Creates a ZoneTreeMaintainer.
Declaration
public ZoneTreeMaintainer(IZoneTree<TKey, TValue> zoneTree, bool startJobForCleaningInactiveBlockCaches = true, ILogger logger = null)
Parameters
Type | Name | Description |
---|---|---|
IZoneTree<TKey, TValue> | zoneTree | The ZoneTree |
bool | startJobForCleaningInactiveBlockCaches | Starts periodic timer if true. |
ILogger | logger | The logger |
Properties
| Improve this Doc View SourceDiskSegmentBufferLifeTime
Sets or gets Disk Segment block cache life time in milliseconds. Default value is 10_000 milliseconds.
Declaration
public long DiskSegmentBufferLifeTime { get; set; }
Property Value
Type | Description |
---|---|
long |
EnableJobForCleaningInactiveCaches
Gets or sets a value indicating whether a periodic timer is enabled to release
unused block and key/value record caches in the disk segment.
Changing this property will start or stop the periodic timer accordingly.
The default value is false
.
Declaration
public bool EnableJobForCleaningInactiveCaches { get; set; }
Property Value
Type | Description |
---|---|
bool |
InactiveBlockCacheCleanupInterval
Gets or sets the interval for the periodic timer that triggers the cleanup job. The default value is 5 seconds.
Declaration
public TimeSpan InactiveBlockCacheCleanupInterval { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
Maintenance
The associated ZoneTree maintenance instance.
Declaration
public IZoneTreeMaintenance<TKey, TValue> Maintenance { get; }
Property Value
Type | Description |
---|---|
IZoneTreeMaintenance<TKey, TValue> |
MaximumReadOnlySegmentCount
Starts merge operation when read-only segments count exceeds this value. Default value is 64.
Declaration
public int MaximumReadOnlySegmentCount { get; set; }
Property Value
Type | Description |
---|---|
int |
MinimumSparseArrayLength
Minimum sparse array length when a new disk segment is created. Default value is 0.
Declaration
public int MinimumSparseArrayLength { get; set; }
Property Value
Type | Description |
---|---|
int |
SparseArrayStepLength
Configures sparse array step length when the disk segment length is bigger than
MinimumSparseArrayLength * SparseArrayStepLength.
The default value is 1000.
Declaration
public int SparseArrayStepLength { get; set; }
Property Value
Type | Description |
---|---|
int |
ThresholdForMergeOperationStart
Starts merge operation when records count in read-only segments exceeds this value. Default value is 0.
Declaration
public int ThresholdForMergeOperationStart { get; set; }
Property Value
Type | Description |
---|---|
int |
ZoneTree
The associated ZoneTree instance.
Declaration
public IZoneTree<TKey, TValue> ZoneTree { get; }
Property Value
Type | Description |
---|---|
IZoneTree<TKey, TValue> |
Methods
| Improve this Doc View SourceWaitForBackgroundThreads()
Waits until all running tasks are completed.
Declaration
public void WaitForBackgroundThreads()
Dispose()
Disposes this maintainer.
Declaration
public void Dispose()
TryCancelBackgroundThreads()
Tries cancel running tasks.
Declaration
public void TryCancelBackgroundThreads()