Show / Hide Table of Contents

Interface IStateMachine

Represents state machine.

Inherited Members
ISnapshotManager.Snapshot
ISnapshotManager.ReclaimGarbageAsync(long, CancellationToken)
Namespace: DotNext.Net.Cluster.Consensus.Raft.StateMachine
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IStateMachine : ISnapshotManager

Methods

| Edit this page View Source

ApplyAsync(LogEntry, CancellationToken)

Applies the log entry to the underlying state machine.

Declaration
ValueTask<long> ApplyAsync(LogEntry entry, CancellationToken token)
Parameters
Type Name Description
LogEntry entry

The log entry to be applied.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<long>

The index of the last applied log entry. It should be greater than or equal to Index.

Remarks

This method is never called concurrently by WriteAheadLog infrastructure. However, it can be called concurrently with Snapshot or ReclaimGarbageAsync(long, CancellationToken) methods. The implementation can create a new snapshot on the disk. In this case, it should replace the current snapshot and Snapshot will return newly generated snapshot.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾