Show / Hide Table of Contents

Class ConsensusOnlyState

Represents lightweight Raft node state that is suitable for distributed consensus only.

Inheritance
Object
Disposable
ConsensusOnlyState
Implements
IDisposable
IPersistentState
Log.IAuditTrail<IRaftLogEntry>
Inherited Members
Disposable.IsDisposed
Disposable.ThrowIfDisposed()
Disposable.DisposedTask
Disposable.GetDisposedTask<T>()
Disposable.TrySetDisposedException<T>(TaskCompletionSource<T>)
Disposable.Dispose()
Disposable.QueueDispose(IDisposable)
Disposable.Dispose(IEnumerable<IDisposable>)
Disposable.DisposeAsync(IEnumerable<IAsyncDisposable>)
Disposable.Dispose(IDisposable[])
Disposable.DisposeAsync(IAsyncDisposable[])
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: DotNext.Net.Cluster.Consensus.Raft
Assembly: DotNext.Net.Cluster.dll
Syntax
public sealed class ConsensusOnlyState : Disposable, IDisposable, IPersistentState, Log.IAuditTrail<IRaftLogEntry>
Remarks

The actual state doesn't persist on disk and exists only in memory. Moreover, this implementation cannot append non-empty log entries.

Methods

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

Overrides
Disposable.Dispose(Boolean)
| 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.EnsureConsistencyAsync(TimeSpan, CancellationToken)

Declaration
Task IPersistentState.EnsureConsistencyAsync(TimeSpan timeout, CancellationToken token)
Parameters
Type Name Description
TimeSpan timeout
CancellationToken token
Returns
Type Description
Task
| 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

Implements

System.IDisposable
IPersistentState
IAuditTrail<TEntry>

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