Show / Hide Table of Contents

Class InMemoryAuditTrail

Represents in-memory audit trail for Raft-based cluster node.

Inheritance
Object
InMemoryAuditTrail
Implements
IPersistentState
IAuditTrail<IRaftLogEntry>
IAuditTrail
Namespace: DotNext.Net.Cluster.Consensus.Raft
Assembly: DotNext.Net.Cluster.dll
Syntax
public class InMemoryAuditTrail : Disposable, IPersistentState, IAuditTrail<IRaftLogEntry>, IAuditTrail
Remarks

In-memory audit trail doesn't support compaction. It is recommended to use this audit trail for testing purposes only.

Constructors

| Improve this Doc View Source

InMemoryAuditTrail()

Initializes a new audit trail with empty log.

Declaration
public InMemoryAuditTrail()

Properties

| Improve this Doc View Source

SyncRoot

Gets the lock that can be used to synchronize access to this object.

Declaration
protected AsyncLock SyncRoot { get; }
Property Value
Type Description
AsyncLock

Methods

| Improve this Doc View Source

ApplyAsync(IRaftLogEntry)

Applies the command represented by the log entry to the underlying database engine.

Declaration
protected virtual ValueTask ApplyAsync(IRaftLogEntry entry)
Parameters
Type Name Description
IRaftLogEntry entry

The entry to be applied to the state machine.

Returns
Type Description
ValueTask

The task representing asynchronous execution of this method.

| Improve this Doc View Source

Dispose(Boolean)

Releases all resources associated with this audit trail.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

Indicates whether the Dispose(Boolean) has been called directly or from finalizer.

| Improve this Doc View Source

FlushAsync()

Flushes the underlying data storage.

Declaration
protected virtual ValueTask FlushAsync()
Returns
Type Description
ValueTask

The task representing asynchronous execution of this method.

| Improve this Doc View Source

GetLastIndex(Boolean)

Gets index of the committed or last log entry.

Declaration
public long GetLastIndex(bool committed)
Parameters
Type Name Description
Boolean committed

true to get the index of highest log entry known to be committed; false to get the index of the last log entry.

Returns
Type Description
Int64

The index of the log entry.

Explicit Interface Implementations

| Improve this Doc View Source

IPersistentState.IncrementTermAsync()

Declaration
ValueTask<long> IPersistentState.IncrementTermAsync()
Returns
Type Description
ValueTask<Int64>
| Improve this Doc View Source

IPersistentState.IsVotedFor(IRaftClusterMember)

Declaration
bool IPersistentState.IsVotedFor(IRaftClusterMember member)
Parameters
Type Name Description
IRaftClusterMember member
Returns
Type Description
Boolean
| Improve this Doc View Source

IPersistentState.Term

Declaration
long IPersistentState.Term { get; }
Returns
Type Description
Int64
| Improve this Doc View Source

IPersistentState.UpdateTermAsync(Int64)

Declaration
ValueTask IPersistentState.UpdateTermAsync(long value)
Parameters
Type Name Description
Int64 value
Returns
Type Description
ValueTask
| Improve this Doc View Source

IPersistentState.UpdateVotedForAsync(IRaftClusterMember)

Declaration
ValueTask IPersistentState.UpdateVotedForAsync(IRaftClusterMember member)
Parameters
Type Name Description
IRaftClusterMember member
Returns
Type Description
ValueTask
| Improve this Doc View Source

IAuditTrail.CommitAsync(CancellationToken)

Declaration
ValueTask<long> IAuditTrail.CommitAsync(CancellationToken token)
Parameters
Type Name Description
CancellationToken token
Returns
Type Description
ValueTask<Int64>
| Improve this Doc View Source

IAuditTrail.CommitAsync(Int64, CancellationToken)

Declaration
ValueTask<long> IAuditTrail.CommitAsync(long endIndex, CancellationToken token)
Parameters
Type Name Description
Int64 endIndex
CancellationToken token
Returns
Type Description
ValueTask<Int64>
| Improve this Doc View Source

IAuditTrail.EnsureConsistencyAsync(CancellationToken)

Declaration
Task IAuditTrail.EnsureConsistencyAsync(CancellationToken token)
Parameters
Type Name Description
CancellationToken token
Returns
Type Description
Task
| Improve this Doc View Source

IAuditTrail.WaitForCommitAsync(Int64, TimeSpan, CancellationToken)

Declaration
Task IAuditTrail.WaitForCommitAsync(long index, TimeSpan timeout, CancellationToken token)
Parameters
Type Name Description
Int64 index
TimeSpan timeout
CancellationToken token
Returns
Type Description
Task
| Improve this Doc View Source

IAuditTrail<IRaftLogEntry>.AppendAsync<TEntryImpl>(TEntryImpl, Int64)

Declaration
ValueTask IAuditTrail<IRaftLogEntry>.AppendAsync<TEntry>(TEntry entry, long startIndex)

    where TEntry : IRaftLogEntry
Parameters
Type Name Description
TEntry entry
Int64 startIndex
Returns
Type Description
ValueTask
Type Parameters
Name Description
TEntry
| Improve this Doc View Source

IAuditTrail<IRaftLogEntry>.AppendAsync<TEntryImpl>(ILogEntryProducer<TEntryImpl>, CancellationToken)

Declaration
ValueTask<long> IAuditTrail<IRaftLogEntry>.AppendAsync<TEntry>(ILogEntryProducer<TEntry> entries, CancellationToken token)

    where TEntry : IRaftLogEntry
Parameters
Type Name Description
ILogEntryProducer<TEntry> entries
CancellationToken token
Returns
Type Description
ValueTask<Int64>
Type Parameters
Name Description
TEntry
| Improve this Doc View Source

IAuditTrail<IRaftLogEntry>.AppendAsync<TEntryImpl>(ILogEntryProducer<TEntryImpl>, Int64, Boolean, CancellationToken)

Declaration
ValueTask IAuditTrail<IRaftLogEntry>.AppendAsync<TEntry>(ILogEntryProducer<TEntry> entries, long startIndex, bool skipCommitted, CancellationToken token)

    where TEntry : IRaftLogEntry
Parameters
Type Name Description
ILogEntryProducer<TEntry> entries
Int64 startIndex
Boolean skipCommitted
CancellationToken token
Returns
Type Description
ValueTask
Type Parameters
Name Description
TEntry
| Improve this Doc View Source

IAuditTrail<IRaftLogEntry>.DropAsync(Int64, CancellationToken)

Declaration
ValueTask<long> IAuditTrail<IRaftLogEntry>.DropAsync(long startIndex, CancellationToken token)
Parameters
Type Name Description
Int64 startIndex
CancellationToken token
Returns
Type Description
ValueTask<Int64>
| Improve this Doc View Source

IAuditTrail<IRaftLogEntry>.First

Declaration
IRaftLogEntry IAuditTrail<IRaftLogEntry>.First { get; }
Returns
Type Description
IRaftLogEntry
| Improve this Doc View Source

IAuditTrail<IRaftLogEntry>.ReadAsync<TReader, TResult>(TReader, Int64, CancellationToken)

Declaration
ValueTask<TResult> IAuditTrail<IRaftLogEntry>.ReadAsync<TReader, TResult>(TReader reader, long startIndex, CancellationToken token)

    where TReader : ILogEntryConsumer<IRaftLogEntry, TResult>
Parameters
Type Name Description
TReader reader
Int64 startIndex
CancellationToken token
Returns
Type Description
ValueTask<TResult>
Type Parameters
Name Description
TReader
TResult
| Improve this Doc View Source

IAuditTrail<IRaftLogEntry>.ReadAsync<TReader, TResult>(TReader, Int64, Int64, CancellationToken)

Declaration
ValueTask<TResult> IAuditTrail<IRaftLogEntry>.ReadAsync<TReader, TResult>(TReader reader, long startIndex, long endIndex, CancellationToken token)

    where TReader : ILogEntryConsumer<IRaftLogEntry, TResult>
Parameters
Type Name Description
TReader reader
Int64 startIndex
Int64 endIndex
CancellationToken token
Returns
Type Description
ValueTask<TResult>
Type Parameters
Name Description
TReader
TResult

Implements

IPersistentState
IAuditTrail<TEntry>
IAuditTrail

Extension Methods

AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, CancellationToken)
ExpressionBuilder.Const<T>(T)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, R1, R2>(T, Func<T, R1>, Func<T, R2>, out R1, out R2)
ObjectExtensions.Decompose<T, R1, R2>(T, ValueFunc<T, R1>, ValueFunc<T, R2>, out R1, out R2)
ObjectExtensions.Decompose<T, R1, R2>(T, Func<T, R1>, Func<T, R2>)
ObjectExtensions.Decompose<T, R1, R2>(T, ValueFunc<T, R1>, ValueFunc<T, R2>)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX