Show / Hide Table of Contents

Interface IPersistentState

Represents persistent state of local cluster member required by Raft consensus protocol.

Namespace: DotNext.Net.Cluster.Consensus.Raft
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IPersistentState : Log.IAuditTrail<IRaftLogEntry>

Properties

| Improve this Doc View Source

Term

Reads Term value associated with the local member from the persistent storage.

Declaration
long Term { get; }
Property Value
Type Description
Int64

The term restored from persistent storage.

Methods

| Improve this Doc View Source

EnsureConsistencyAsync(TimeSpan, CancellationToken)

Suspens the caller until the log entry with term equal to Term will be committed.

Declaration
Task EnsureConsistencyAsync(TimeSpan timeout, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
TimeSpan timeout

The time to wait.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
Task

The task representing state of the asynchronous execution.

Exceptions
Type Condition
OperationCanceledException

The operation has been canceled.

TimeoutException

Timeout occurred.

| Improve this Doc View Source

IncrementTermAsync()

Increments Term value.

Declaration
ValueTask<long> IncrementTermAsync()
Returns
Type Description
ValueTask<Int64>

The updated Term value.

| Improve this Doc View Source

IsVotedFor(IRaftClusterMember)

Determines whether the local member granted its vote for the specified remote member.

Declaration
bool IsVotedFor(IRaftClusterMember member)
Parameters
Type Name Description
IRaftClusterMember member

The cluster member to check.

Returns
Type Description
Boolean

true if the local member granted its vote for the specified remote member; otherwise, false.

| Improve this Doc View Source

UpdateTermAsync(Int64)

Persists the last actual Term.

Declaration
ValueTask UpdateTermAsync(long term)
Parameters
Type Name Description
Int64 term

The term value to be persisted.

Returns
Type Description
ValueTask

The task representing asynchronous execution of the operation.

| Improve this Doc View Source

UpdateVotedForAsync(IRaftClusterMember)

Persists the item that was voted for on in the last vote.

Declaration
ValueTask UpdateVotedForAsync(IRaftClusterMember member)
Parameters
Type Name Description
IRaftClusterMember member

The member which identifier should be stored inside of persistence storage. May be null.

Returns
Type Description
ValueTask

The task representing state of the asynchronous execution.

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)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>)
ObjectExtensions.As<T>(T)
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)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX