Show / Hide Table of Contents

Interface IAuditTrail

Represents audit trail responsible for maintaining log entries.

Namespace: DotNext.Net.Cluster.Replication
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IAuditTrail

Methods

| Improve this Doc View Source

CommitAsync(CancellationToken)

Commits log entries into the underlying storage and marks these entries as committed.

Declaration
ValueTask<long> CommitAsync(CancellationToken token = null)
Parameters
Type Name Description
CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<Int64>

The actual number of committed entries.

Remarks

This method should updates cached value provided by method GetLastIndex(Boolean) called with argument of value true. Additionally, it may force log compaction and squash all committed entries into single entry called snapshot.

| Improve this Doc View Source

CommitAsync(Int64, CancellationToken)

Commits log entries into the underlying storage and marks these entries as committed.

Declaration
ValueTask<long> CommitAsync(long endIndex, CancellationToken token = null)
Parameters
Type Name Description
Int64 endIndex

The index of the last entry to commit, inclusively; if null then commits all log entries started from the first uncommitted entry to the last existing log entry.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<Int64>

The actual number of committed entries.

Remarks

This method should updates cached value provided by method GetLastIndex(Boolean) called with argument of value true. Additionally, it may force log compaction and squash all committed entries into single entry called snapshot.

| Improve this Doc View Source

EnsureConsistencyAsync(CancellationToken)

Ensures that all committed entries are applied to the underlying data state machine known as database engine.

Declaration
Task EnsureConsistencyAsync(CancellationToken token = null)
Parameters
Type Name Description
CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
Task

The task representing asynchronous state of the method.

| Improve this Doc View Source

GetLastIndex(Boolean)

Gets index of the committed or last log entry.

Declaration
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.

Remarks

This method is synchronous because returning value should be cached and updated in memory by implementing class.

| Improve this Doc View Source

WaitForCommitAsync(Int64, TimeSpan, CancellationToken)

Waits for the commit.

Declaration
Task WaitForCommitAsync(long index, TimeSpan timeout, CancellationToken token = null)
Parameters
Type Name Description
Int64 index

The index of the log record to be committed.

TimeSpan timeout

The timeout used to wait for the commit.

CancellationToken token

The token that can be used to cancel waiting.

Returns
Type Description
Task

The task representing waiting operation.

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