Search Results for

    Show / Hide Table of Contents

    Interface ITransactionalZoneTree<TKey, TValue>

    The interface for the core functionality of a transactional ZoneTree.

    Inherited Members
    IDisposable.Dispose()
    Namespace: Tenray.ZoneTree
    Assembly: ZoneTree.dll
    Syntax
    public interface ITransactionalZoneTree<TKey, TValue> : IDisposable
    Type Parameters
    Name Description
    TKey

    The key type

    TValue

    The value type

    Properties

    | Improve this Doc View Source

    IsReadOnly

    Enables read-only mode.

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

    Logger

    ZoneTree Logger.

    Declaration
    ILogger Logger { get; }
    Property Value
    Type Description
    ILogger
    | Improve this Doc View Source

    Maintenance

    Returns maintenance object belongs to this TransactionalZoneTree.

    Declaration
    ITransactionalZoneTreeMaintenance<TKey, TValue> Maintenance { get; }
    Property Value
    Type Description
    ITransactionalZoneTreeMaintenance<TKey, TValue>

    Methods

    | Improve this Doc View Source

    BeginFluentTransaction()

    Creates a fluent transaction.

    Declaration
    FluentTransaction<TKey, TValue> BeginFluentTransaction()
    Returns
    Type Description
    FluentTransaction<TKey, TValue>

    Fluent transaction.

    | Improve this Doc View Source

    BeginTransaction()

    Begins the transaction. Creates a transaction id and informs the transaction manager that a new transaction started.

    Declaration
    long BeginTransaction()
    Returns
    Type Description
    long

    Transaction Id

    | Improve this Doc View Source

    Commit(long)

    Commits if the transaction is in ready to commit state. It is necessary to call PrepareCommit before calling this method.

    Declaration
    CommitResult Commit(long transactionId)
    Parameters
    Type Name Description
    long transactionId
    Returns
    Type Description
    CommitResult
    Exceptions
    Type Condition
    TransactionIsNotReadyToCommitException
    TransactionAbortedException
    | Improve this Doc View Source

    CommitNoThrow(long)

    Commits if the transaction is in ready to commit state. It is necessary to call PrepareCommit before calling this method. This method does not throw transaction aborted exception.

    Declaration
    CommitResult CommitNoThrow(long transactionId)
    Parameters
    Type Name Description
    long transactionId
    Returns
    Type Description
    CommitResult
    Exceptions
    Type Condition
    TransactionIsNotReadyToCommitException
    | Improve this Doc View Source

    ContainsKey(long, in TKey)

    Contains Key query.

    Declaration
    bool ContainsKey(long transactionId, in TKey key)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    TKey key

    Key

    Returns
    Type Description
    bool
    Exceptions
    Type Condition
    TransactionAbortedException
    | Improve this Doc View Source

    ContainsKeyNoThrow(long, in TKey)

    Contains Key query without abort exception.

    Declaration
    TransactionResult<bool> ContainsKeyNoThrow(long transactionId, in TKey key)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    TKey key

    Key

    Returns
    Type Description
    TransactionResult<bool>
    | Improve this Doc View Source

    CreateMaintainer()

    Creates the default ZoneTree Maintainer.

    Declaration
    IMaintainer CreateMaintainer()
    Returns
    Type Description
    IMaintainer
    | Improve this Doc View Source

    Delete(long, in TKey)

    Deletes the key.

    Declaration
    void Delete(long transactionId, in TKey key)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    TKey key

    Key

    Exceptions
    Type Condition
    TransactionAbortedException
    | Improve this Doc View Source

    DeleteAutoCommit(in TKey)

    Starts a transaction, deletes the key-value, and commits the transaction.

    Declaration
    void DeleteAutoCommit(in TKey key)
    Parameters
    Type Name Description
    TKey key

    Key

    | Improve this Doc View Source

    DeleteNoThrow(long, in TKey)

    Deletes the key without abort exception.

    Declaration
    TransactionResult DeleteNoThrow(long transactionId, in TKey key)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    TKey key

    Key

    Returns
    Type Description
    TransactionResult
    | Improve this Doc View Source

    GetTransactionState(long)

    Retrieves transaction state of given transaction id.

    Declaration
    TransactionState GetTransactionState(long transactionId)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    Returns
    Type Description
    TransactionState

    Transaction State

    | Improve this Doc View Source

    Prepare(long)

    Prepares to Commit. Aborts transaction if needed.

    Declaration
    CommitResult Prepare(long transactionId)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    Returns
    Type Description
    CommitResult
    Exceptions
    Type Condition
    TransactionAbortedException
    | Improve this Doc View Source

    PrepareAndCommit(long)

    Prepares to Commit. Aborts transaction if needed. If commit is possible does the commit.

    Declaration
    CommitResult PrepareAndCommit(long transactionId)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    Returns
    Type Description
    CommitResult
    Exceptions
    Type Condition
    TransactionAbortedException
    | Improve this Doc View Source

    PrepareAndCommitNoThrow(long)

    Prepares to Commit. Aborts transaction if needed. If commit is possible does the commit. This method does not throw transaction aborted exception.

    Declaration
    CommitResult PrepareAndCommitNoThrow(long transactionId)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    Returns
    Type Description
    CommitResult
    | Improve this Doc View Source

    PrepareNoThrow(long)

    Prepares to Commit. Aborts transaction if needed. This method does not throw transaction aborted exception.

    Declaration
    CommitResult PrepareNoThrow(long transactionId)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    Returns
    Type Description
    CommitResult
    | Improve this Doc View Source

    ReadCommittedContainsKey(in TKey, long)

    Contains Key query without a transaction. This method avoids dirty reads. The query is executed on committed data. If current transaction id given, this method reads uncommitted key for given transaction and committed keys for other transactions.

    Declaration
    bool ReadCommittedContainsKey(in TKey key, long currentTransactionId = -1)
    Parameters
    Type Name Description
    TKey key

    Key

    long currentTransactionId

    Current transaction.

    Returns
    Type Description
    bool
    | Improve this Doc View Source

    ReadCommittedTryGet(in TKey, out TValue, long)

    Tries to get the value of given key without a transaction. This method avoids dirty reads. The query is executed on committed data. If current transaction id given, this method reads uncommitted key for given transaction and committed keys for other transactions.

    Declaration
    bool ReadCommittedTryGet(in TKey key, out TValue value, long currentTransactionId = -1)
    Parameters
    Type Name Description
    TKey key

    Key

    TValue value

    Value

    long currentTransactionId

    Current transaction.

    Returns
    Type Description
    bool
    | Improve this Doc View Source

    Rollback(long)

    Rollbacks the transaction by undoing all writes by this transaction.

    Declaration
    void Rollback(long transactionId)
    Parameters
    Type Name Description
    long transactionId
    | Improve this Doc View Source

    TryGet(long, in TKey, out TValue)

    Tries to get the value of given key.

    Declaration
    bool TryGet(long transactionId, in TKey key, out TValue value)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    TKey key

    Key

    TValue value

    Value

    Returns
    Type Description
    bool

    true if key is found, otherwise false.

    Exceptions
    Type Condition
    TransactionAbortedException
    | Improve this Doc View Source

    TryGetNoThrow(long, in TKey, out TValue)

    Tries to get the value of given key without abort exception.

    Declaration
    TransactionResult<bool> TryGetNoThrow(long transactionId, in TKey key, out TValue value)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    TKey key

    Key

    TValue value

    Value

    Returns
    Type Description
    TransactionResult<bool>

    true if key is found, otherwise false.

    | Improve this Doc View Source

    Upsert(long, in TKey, in TValue)

    Upserts the key and value.

    Declaration
    bool Upsert(long transactionId, in TKey key, in TValue value)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    TKey key

    Key

    TValue value

    Value

    Returns
    Type Description
    bool

    true if the key/value pair was inserted; false if the key/value pair was updated.

    Exceptions
    Type Condition
    TransactionAbortedException
    | Improve this Doc View Source

    UpsertAutoCommit(in TKey, in TValue)

    Starts a transaction, upserts the key-value, and commits the transaction.

    Declaration
    void UpsertAutoCommit(in TKey key, in TValue value)
    Parameters
    Type Name Description
    TKey key

    Key

    TValue value

    Value

    | Improve this Doc View Source

    UpsertNoThrow(long, in TKey, in TValue)

    Upserts the key and value without abort exception.

    Declaration
    TransactionResult<bool> UpsertNoThrow(long transactionId, in TKey key, in TValue value)
    Parameters
    Type Name Description
    long transactionId

    Transaction Id

    TKey key

    Key

    TValue value

    Value

    Returns
    Type Description
    TransactionResult<bool>

    true if the key/value pair was inserted; false if the key/value pair was updated.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2022 Tenray.io