Show / Hide Table of Contents

Interface IRaftClusterMember

Represents cluster member accessible through Raft protocol.

Inherited Members
IClusterMember.Endpoint
IClusterMember.Id
IClusterMember.IsLeader
IClusterMember.IsRemote
IClusterMember.MemberStatusChanged
IClusterMember.Status
IClusterMember.GetMetadataAsync(Boolean, CancellationToken)
IClusterMember.ResignAsync(CancellationToken)
IClusterMember.OnMemberStatusChanged(IClusterMember, AtomicEnum<ClusterMemberStatus>, ClusterMemberStatus, ClusterMemberStatusChanged)
Namespace: DotNext.Net.Cluster.Consensus.Raft
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IRaftClusterMember : IClusterMember

Properties

| Improve this Doc View Source

NextIndex

Index of next log entry to send to this node.

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

Methods

| Improve this Doc View Source

AppendEntriesAsync<TEntry, TList>(Int64, TList, Int64, Int64, Int64, CancellationToken)

Transfers transaction log entry to the member.

Declaration
Task<Result<bool>> AppendEntriesAsync<TEntry, TList>(long term, TList entries, long prevLogIndex, long prevLogTerm, long commitIndex, CancellationToken token)

    where TEntry : IRaftLogEntry where TList : IReadOnlyList<TEntry>
Parameters
Type Name Description
Int64 term

Term value maintained by local cluster member.

TList entries

A set of entries to be replicated with this node.

Int64 prevLogIndex

Index of log entry immediately preceding new ones.

Int64 prevLogTerm

Term of prevLogIndex entry.

Int64 commitIndex

Last entry known to be committed by the local node.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns
Type Description
Task<Result<Boolean>>

true if message is handled successfully by this member; false if message is rejected due to invalid Term/Index number.

Type Parameters
Name Description
TEntry

The type of the log entry.

TList

The type of the log entries list.

Exceptions
Type Condition
MemberUnavailableException

The member is unreachable through network.

| Improve this Doc View Source

CancelPendingRequests()

Aborts all active outbound requests.

Declaration
[Obsolete("Use CancelPendingRequestsAsync method instead")]
virtual void CancelPendingRequests()
| Improve this Doc View Source

CancelPendingRequestsAsync()

Aborts all active outbound requests asynchronously.

Declaration
virtual ValueTask CancelPendingRequestsAsync()
Returns
Type Description
ValueTask

The task representing shutdown operation.

| Improve this Doc View Source

InstallSnapshotAsync(Int64, IRaftLogEntry, Int64, CancellationToken)

Installs the snapshot of the log to this cluster member.

Declaration
Task<Result<bool>> InstallSnapshotAsync(long term, IRaftLogEntry snapshot, long snapshotIndex, CancellationToken token)
Parameters
Type Name Description
Int64 term

Leader's term.

IRaftLogEntry snapshot

The log entry representing the snapshot.

Int64 snapshotIndex

The index of the last included log entry in the snapshot.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns
Type Description
Task<Result<Boolean>>

true if snapshot is installed successfully; otherwise, false.

Exceptions
Type Condition
MemberUnavailableException

The member is unreachable through network.

| Improve this Doc View Source

VoteAsync(Int64, Int64, Int64, CancellationToken)

Requests vote from the member.

Declaration
Task<Result<bool>> VoteAsync(long term, long lastLogIndex, long lastLogTerm, CancellationToken token)
Parameters
Type Name Description
Int64 term

Term value maintained by local cluster member.

Int64 lastLogIndex

Index of candidate's last log entry.

Int64 lastLogTerm

Term of candidate's last log entry.

CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns
Type Description
Task<Result<Boolean>>

Vote received from member; true if node accepts new leader, false if node doesn't accept new leader, null if node is not available.

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