Search Results for

    Show / Hide Table of Contents

    Class BTree<TKey, TValue>

    In memory B+Tree. This class is thread-safe.

    Inheritance
    object
    BTree<TKey, TValue>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Tenray.ZoneTree.Collections.BTree
    Assembly: ZoneTree.dll
    Syntax
    public sealed class BTree<TKey, TValue>
    Type Parameters
    Name Description
    TKey

    Key Type

    TValue

    Value Type

    Constructors

    | Improve this Doc View Source

    BTree(IRefComparer<TKey>, BTreeLockMode, IIncrementalIdProvider, int, int)

    Declaration
    public BTree(IRefComparer<TKey> comparer, BTreeLockMode lockMode, IIncrementalIdProvider indexOpProvider = null, int nodeSize = 128, int leafSize = 128)
    Parameters
    Type Name Description
    IRefComparer<TKey> comparer
    BTreeLockMode lockMode
    IIncrementalIdProvider indexOpProvider
    int nodeSize
    int leafSize

    Fields

    | Improve this Doc View Source

    Comparer

    Declaration
    public readonly IRefComparer<TKey> Comparer
    Field Value
    Type Description
    IRefComparer<TKey>
    | Improve this Doc View Source

    LockMode

    Declaration
    public readonly BTreeLockMode LockMode
    Field Value
    Type Description
    BTreeLockMode

    Properties

    | Improve this Doc View Source

    IsReadOnly

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

    LastOpIndex

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

    Length

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

    OpIndexProvider

    Declaration
    public IIncrementalIdProvider OpIndexProvider { get; }
    Property Value
    Type Description
    IIncrementalIdProvider

    Methods

    | Improve this Doc View Source

    AddOrUpdate(in TKey, AddDelegate, UpdateDelegate, out long)

    Declaration
    public AddOrUpdateResult AddOrUpdate(in TKey key, BTree<TKey, TValue>.AddDelegate adder, BTree<TKey, TValue>.UpdateDelegate updater, out long opIndex)
    Parameters
    Type Name Description
    TKey key
    BTree<TKey, TValue>.AddDelegate adder
    BTree<TKey, TValue>.UpdateDelegate updater
    long opIndex
    Returns
    Type Description
    AddOrUpdateResult
    | Improve this Doc View Source

    ContainsKey(in TKey)

    Declaration
    public bool ContainsKey(in TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    bool
    | Improve this Doc View Source

    GetFirstIterator()

    Declaration
    public BTree<TKey, TValue>.NodeIterator GetFirstIterator()
    Returns
    Type Description
    BTree<TKey, TValue>.NodeIterator
    | Improve this Doc View Source

    GetFrozenFirstIterator()

    Declaration
    public BTree<TKey, TValue>.FrozenNodeIterator GetFrozenFirstIterator()
    Returns
    Type Description
    BTree<TKey, TValue>.FrozenNodeIterator
    | Improve this Doc View Source

    GetFrozenIteratorWithFirstKeyGreaterOrEqual(in TKey)

    Declaration
    public BTree<TKey, TValue>.FrozenNodeIterator GetFrozenIteratorWithFirstKeyGreaterOrEqual(in TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    BTree<TKey, TValue>.FrozenNodeIterator
    | Improve this Doc View Source

    GetFrozenIteratorWithLastKeySmallerOrEqual(in TKey)

    Declaration
    public BTree<TKey, TValue>.FrozenNodeIterator GetFrozenIteratorWithLastKeySmallerOrEqual(in TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    BTree<TKey, TValue>.FrozenNodeIterator
    | Improve this Doc View Source

    GetFrozenLastIterator()

    Declaration
    public BTree<TKey, TValue>.FrozenNodeIterator GetFrozenLastIterator()
    Returns
    Type Description
    BTree<TKey, TValue>.FrozenNodeIterator
    | Improve this Doc View Source

    GetIteratorWithFirstKeyGreaterOrEqual(in TKey)

    Declaration
    public BTree<TKey, TValue>.NodeIterator GetIteratorWithFirstKeyGreaterOrEqual(in TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    BTree<TKey, TValue>.NodeIterator
    | Improve this Doc View Source

    GetIteratorWithLastKeySmallerOrEqual(in TKey)

    Declaration
    public BTree<TKey, TValue>.NodeIterator GetIteratorWithLastKeySmallerOrEqual(in TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    BTree<TKey, TValue>.NodeIterator
    | Improve this Doc View Source

    GetLastIterator()

    Declaration
    public BTree<TKey, TValue>.NodeIterator GetLastIterator()
    Returns
    Type Description
    BTree<TKey, TValue>.NodeIterator
    | Improve this Doc View Source

    SetNextOpIndex(long)

    Declaration
    public void SetNextOpIndex(long nextId)
    Parameters
    Type Name Description
    long nextId
    | Improve this Doc View Source

    SetTreeReadOnlyAndLockFree()

    Converts BTree to lock-free BTree by removing top level locks and all locks from nodes. It is caller's responsibility to not to modify the tree after this method is called. It is also caller's responsibility to ensure all ongoing writes are already finished.

    Declaration
    public void SetTreeReadOnlyAndLockFree()
    | Improve this Doc View Source

    TryGetValue(in TKey, out TValue)

    Declaration
    public bool TryGetValue(in TKey key, out TValue value)
    Parameters
    Type Name Description
    TKey key
    TValue value
    Returns
    Type Description
    bool
    | Improve this Doc View Source

    TryInsert(in TKey, in TValue, out long)

    Declaration
    public bool TryInsert(in TKey key, in TValue value, out long opIndex)
    Parameters
    Type Name Description
    TKey key
    TValue value
    long opIndex
    Returns
    Type Description
    bool
    | Improve this Doc View Source

    Upsert(in TKey, in TValue, out long)

    Declaration
    public bool Upsert(in TKey key, in TValue value, out long opIndex)
    Parameters
    Type Name Description
    TKey key
    TValue value
    long opIndex
    Returns
    Type Description
    bool
    | Improve this Doc View Source

    Validate()

    Declaration
    public void Validate()
    | Improve this Doc View Source

    ValidateLeafs()

    Declaration
    public void ValidateLeafs()
    | Improve this Doc View Source

    WriteLock()

    Declaration
    public void WriteLock()
    | Improve this Doc View Source

    WriteUnlock()

    Declaration
    public void WriteUnlock()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2022 Tenray.io