RaftCluster<TMember>
public abstract class RaftCluster<TMember> : Disposable, IRaftCluster, IReplicationCluster<IRaftLogEntry>, IReplicationCluster, ICluster, IRaftStateMachine, IAsyncDisposable where TMember : IRaftClusterMember, IDisposable
Represents transport-independent implementation of Raft protocol.
Represents collection of cluster members stored in the memory of the current process.
protected sealed delegate MemberCollectionMutator<TMember> : MulticastDelegate where TMember : IRaftClusterMember, IDisposable
Represents mutator of a collection of cluster members.
protected sealed delegate MemberCollectionMutator<TMember, T> : MulticastDelegate where TMember : IRaftClusterMember, IDisposable
Represents mutator of a collection of cluster members.
Represents cluster member.
Associates audit trail with the current instance.
Gets election timeout used by the local member.
Indicates that local member is a leader.
Gets leader of the cluster.
Gets logger used by this object.
Gets members of Raft-based cluster.
Establishes metrics collector.
Gets Term value maintained by local member.
Gets token that can be used for all internal asynchronous operations.
An event raised when leader has been changed.
Represents an event raised when the local node completes its replication with another
node.
protected Task ChangeMembersAsync<T>(MemberCollectionMutator<TMember, T> mutator, T arg, CancellationToken token)
protected Task ChangeMembersAsync(MemberCollectionMutator<TMember> mutator, CancellationToken token)
Finds cluster member using predicate.
Finds cluster member using predicate.
protected ValueTask<TMember> FindMemberAsync(Func<TMember, CancellationToken, ValueTask<bool>> criteria, CancellationToken token)
Finds cluster member asynchronously using predicate.
Forces replication.
protected Task<Result<bool>> ReceiveEntriesAsync<TEntry>(TMember sender, long senderTerm, ILogEntryProducer<TEntry> entries, long prevLogIndex, long prevLogTerm, long commitIndex, CancellationToken token) where TEntry : IRaftLogEntry
Handles AppendEntries message received from remote cluster member.
protected Task<Result<bool>> ReceivePreVoteAsync(long nextTerm, long lastLogIndex, long lastLogTerm, CancellationToken token)
Receives preliminary vote from the potential Candidate in the cluster.
Revokes leadership of the local node.
protected Task<Result<bool>> ReceiveSnapshotAsync<TSnapshot>(TMember sender, long senderTerm, TSnapshot snapshot, long snapshotIndex, CancellationToken token) where TSnapshot : IRaftLogEntry
Handles InstallSnapshot message received from remote cluster member.
protected Task<Result<bool>> ReceiveVoteAsync(TMember sender, long senderTerm, long lastLogIndex, long lastLogTerm, CancellationToken token)
Votes for the new candidate.
Starts serving local member.
Stops serving local member.
Turns this node into regular state when the node can be elected as leader.