Search Results for

    Show / Hide Table of Contents

    Interface IZoneTreeMaintenance<TKey, TValue>

    The interface for the maintenance of a ZoneTree.

    Namespace: Tenray.ZoneTree
    Assembly: ZoneTree.dll
    Syntax
    public interface IZoneTreeMaintenance<TKey, TValue>
    Type Parameters
    Name Description
    TKey

    The key type

    TValue

    The value type

    Properties

    | Improve this Doc View Source

    BottomSegments

    Gets current bottom segments.

    Declaration
    IReadOnlyList<IDiskSegment<TKey, TValue>> BottomSegments { get; }
    Property Value
    Type Description
    IReadOnlyList<IDiskSegment<TKey, TValue>>
    | Improve this Doc View Source

    DiskSegment

    Gets current disk segment.

    Declaration
    IDiskSegment<TKey, TValue> DiskSegment { get; }
    Property Value
    Type Description
    IDiskSegment<TKey, TValue>
    | Improve this Doc View Source

    InMemoryRecordCount

    Retrieves the total number of records that lies in memory excluding the sparse array records of DiskSegment. In an LSM tree, records can be duplicated across different segments.

    Declaration
    long InMemoryRecordCount { get; }
    Property Value
    Type Description
    long
    | Improve this Doc View Source

    IsBottomSegmentsMerging

    true if bottom segments merge operation is running, otherwise false.

    Declaration
    bool IsBottomSegmentsMerging { get; }
    Property Value
    Type Description
    bool
    | Improve this Doc View Source

    IsMerging

    true if merge operation is running, otherwise false.

    Declaration
    bool IsMerging { get; }
    Property Value
    Type Description
    bool
    | Improve this Doc View Source

    MutableSegment

    Gets current mutable segment. Mutable segment is the only writable part of the LSM tree.

    Declaration
    IMutableSegment<TKey, TValue> MutableSegment { get; }
    Property Value
    Type Description
    IMutableSegment<TKey, TValue>
    | Improve this Doc View Source

    MutableSegmentRecordCount

    Retrieves the number of records in mutable segment.

    Declaration
    long MutableSegmentRecordCount { get; }
    Property Value
    Type Description
    long
    | Improve this Doc View Source

    ReadOnlySegments

    Gets current readonly segments in-memory. MoveMutableSegmentForward operation moves writable segment to the read-only segments layer. The readonly segments remains in memory until merge operation done.

    Declaration
    IReadOnlyList<IReadOnlySegment<TKey, TValue>> ReadOnlySegments { get; }
    Property Value
    Type Description
    IReadOnlyList<IReadOnlySegment<TKey, TValue>>
    | Improve this Doc View Source

    ReadOnlySegmentsCount

    Retrieves the number of read only segments.

    Declaration
    int ReadOnlySegmentsCount { get; }
    Property Value
    Type Description
    int
    | Improve this Doc View Source

    ReadOnlySegmentsRecordCount

    Retrieves the number of records in read-only segments.

    Declaration
    long ReadOnlySegmentsRecordCount { get; }
    Property Value
    Type Description
    long
    | Improve this Doc View Source

    TotalRecordCount

    Retrieves the total number of records that lies in memory and disk excluding the sparse array records of DiskSegments. In an LSM tree, records can be duplicated across different segments. Hence, this is not the actual unique record count of the tree. To get exact record count, a partial database scan is needed. Use Count() and CountFullScan() for actual record count.

    Declaration
    long TotalRecordCount { get; }
    Property Value
    Type Description
    long

    Methods

    | Improve this Doc View Source

    DestroyTree()

    Destroys the tree, deletes entire data and WAL store or folder.

    Declaration
    void DestroyTree()
    | Improve this Doc View Source

    MoveMutableSegmentForward()

    Moves mutable segment into readonly segment. This will clear the writable region of the LSM tree. This method is thread safe and can be called from many threads.

    Declaration
    void MoveMutableSegmentForward()
    | Improve this Doc View Source

    ReleaseCircularKeyCacheRecords()

    Releases expired circular cache key records.

    Declaration
    int ReleaseCircularKeyCacheRecords()
    Returns
    Type Description
    int

    The total number of released cached records.

    | Improve this Doc View Source

    ReleaseCircularValueCacheRecords()

    Releases expired circular cache value records.

    Declaration
    int ReleaseCircularValueCacheRecords()
    Returns
    Type Description
    int

    The total number of released cached records.

    | Improve this Doc View Source

    ReleaseReadBuffers(long)

    Releases internal read buffers that have not been used since the specified tick count.

    Declaration
    int ReleaseReadBuffers(long ticks)
    Parameters
    Type Name Description
    long ticks
    Returns
    Type Description
    int

    The total number of released read buffers.

    | Improve this Doc View Source

    SaveMetaData()

    Saves tree meta data and clears the meta wal record. After calling this method, the JSON meta file contains up to date tree meta data.

    Saving meta file helps following:

    1. Reduce the size of meta wal file.
    2. Make Json meta file up to date to analyze parts of the LSM tree. Because Meta WAL file is not human readable.

    It is up to user to decide when and how frequently save the meta file.

    Declaration
    void SaveMetaData()
    | Improve this Doc View Source

    StartBottomSegmentsMergeOperation(int, int)

    Merges selected bottom segments into a single bottom disk segment.

    Declaration
    Thread StartBottomSegmentsMergeOperation(int fromIndex, int toIndex)
    Parameters
    Type Name Description
    int fromIndex

    The lower bound

    int toIndex

    The upper bound

    Returns
    Type Description
    Thread
    | Improve this Doc View Source

    StartMergeOperation()

    Merges available in-memory read-only segments to the disk segment.

    Declaration
    Thread StartMergeOperation()
    Returns
    Type Description
    Thread
    | Improve this Doc View Source

    TryCancelBottomSegmentsMergeOperation()

    Attempts to cancel bottom segments merge operation.

    Declaration
    void TryCancelBottomSegmentsMergeOperation()
    | Improve this Doc View Source

    TryCancelMergeOperation()

    Attempts to cancel merge operation.

    Declaration
    void TryCancelMergeOperation()

    Events

    | Improve this Doc View Source

    OnBottomSegmentsMergeOperationEnded

    Event is fired when bottom segments merge operation is completed.

    Declaration
    event BottomSegmentsMergeOperationEnded<TKey, TValue> OnBottomSegmentsMergeOperationEnded
    Event Type
    Type Description
    BottomSegmentsMergeOperationEnded<TKey, TValue>
    | Improve this Doc View Source

    OnBottomSegmentsMergeOperationStarted

    Event is fired when bottom segments merge operation is completed.

    Declaration
    event BottomSegmentsMergeOperationStarted<TKey, TValue> OnBottomSegmentsMergeOperationStarted
    Event Type
    Type Description
    BottomSegmentsMergeOperationStarted<TKey, TValue>
    | Improve this Doc View Source

    OnCanNotDropDiskSegment

    Event is fired when a disk segment cannot be dropped. This does not harm the database consistency. The cleanup task can be done later.

    Declaration
    event CanNotDropDiskSegment<TKey, TValue> OnCanNotDropDiskSegment
    Event Type
    Type Description
    CanNotDropDiskSegment<TKey, TValue>
    | Improve this Doc View Source

    OnCanNotDropDiskSegmentCreator

    Event is fired when a disk segment creator cannot be dropped. This does not harm the database consistency. The cleanup task can be done later.

    Declaration
    event CanNotDropDiskSegmentCreator<TKey, TValue> OnCanNotDropDiskSegmentCreator
    Event Type
    Type Description
    CanNotDropDiskSegmentCreator<TKey, TValue>
    | Improve this Doc View Source

    OnCanNotDropReadOnlySegment

    Event is fired when a write ahead log cannot be dropped. This does not harm the database consistency. The cleanup task can be done later.

    Declaration
    event CanNotDropReadOnlySegment<TKey, TValue> OnCanNotDropReadOnlySegment
    Event Type
    Type Description
    CanNotDropReadOnlySegment<TKey, TValue>
    | Improve this Doc View Source

    OnDiskSegmentActivated

    Event is fired when the new disk segment is activated.

    Declaration
    event DiskSegmentCreated<TKey, TValue> OnDiskSegmentActivated
    Event Type
    Type Description
    DiskSegmentCreated<TKey, TValue>
    | Improve this Doc View Source

    OnDiskSegmentCreated

    Event is fired when the new disk segment is created. This is the best moment to initialize a sparse array. SparseArray is an in memory array that reduces disk reads. It is the best practice to call DiskSegment.InitSparseArray() when this event is fired.

    Declaration
    event DiskSegmentCreated<TKey, TValue> OnDiskSegmentCreated
    Event Type
    Type Description
    DiskSegmentCreated<TKey, TValue>
    | Improve this Doc View Source

    OnMergeOperationEnded

    Event is fired when merge operation is completed.

    Declaration
    event MergeOperationEnded<TKey, TValue> OnMergeOperationEnded
    Event Type
    Type Description
    MergeOperationEnded<TKey, TValue>
    | Improve this Doc View Source

    OnMergeOperationStarted

    Event is fired when merge operation is started.

    Declaration
    event MergeOperationStarted<TKey, TValue> OnMergeOperationStarted
    Event Type
    Type Description
    MergeOperationStarted<TKey, TValue>
    | Improve this Doc View Source

    OnMutableSegmentMovedForward

    Event is fired when mutable segment is moved forward.

    Declaration
    event MutableSegmentMovedForward<TKey, TValue> OnMutableSegmentMovedForward
    Event Type
    Type Description
    MutableSegmentMovedForward<TKey, TValue>
    | Improve this Doc View Source

    OnZoneTreeIsDisposing

    Event is fired when the ZoneTree is disposing.

    Declaration
    event ZoneTreeIsDisposing<TKey, TValue> OnZoneTreeIsDisposing
    Event Type
    Type Description
    ZoneTreeIsDisposing<TKey, TValue>
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2022 Tenray.io