Show / Hide Table of Contents

Class RaftCluster

Represents default implementation of Raft-based cluster.

Inheritance
Object
Disposable
RaftCluster<RaftClusterMember>
RaftCluster
Implements
IDisposable
IRaftCluster
IReplicationCluster<IRaftLogEntry>
IReplicationCluster
ICluster
Inherited Members
RaftCluster<RaftClusterMember>.Logger
RaftCluster<RaftClusterMember>.IRaftCluster.ElectionTimeout
RaftCluster<RaftClusterMember>.IsLeaderLocal
RaftCluster<RaftClusterMember>.AuditTrail
RaftCluster<RaftClusterMember>.Token
RaftCluster<RaftClusterMember>.ChangeMembersAsync(RaftCluster.MemberCollectionMutator<>, CancellationToken)
RaftCluster<RaftClusterMember>.ChangeMembersAsync(RaftCluster.MemberCollectionMutator<>)
RaftCluster<RaftClusterMember>.Members
RaftCluster<RaftClusterMember>.ICluster.Members
RaftCluster<RaftClusterMember>.Metrics
RaftCluster<RaftClusterMember>.Term
RaftCluster<RaftClusterMember>.LeaderChanged
RaftCluster<RaftClusterMember>.ICluster.Leader
RaftCluster<RaftClusterMember>.Leader
RaftCluster<RaftClusterMember>.FindMember(Predicate<RaftClusterMember>)
RaftCluster<RaftClusterMember>.FindMember<TArg>(Func<RaftClusterMember, TArg, Boolean>, TArg)
RaftCluster<RaftClusterMember>.ReceiveSnapshotAsync<TSnapshot>(RaftClusterMember, Int64, TSnapshot, Int64, CancellationToken)
RaftCluster<RaftClusterMember>.ReceiveSnapshot(RaftClusterMember, Int64, IRaftLogEntry, Int64)
RaftCluster<RaftClusterMember>.ReceiveEntriesAsync<TEntry>(RaftClusterMember, Int64, ILogEntryProducer<TEntry>, Int64, Int64, Int64, CancellationToken)
RaftCluster<RaftClusterMember>.ReceiveEntries<TEntry>(RaftClusterMember, Int64, ILogEntryProducer<TEntry>, Int64, Int64, Int64)
RaftCluster<RaftClusterMember>.ReceiveVoteAsync(RaftClusterMember, Int64, Int64, Int64, CancellationToken)
RaftCluster<RaftClusterMember>.ReceiveVote(RaftClusterMember, Int64, Int64, Int64)
RaftCluster<RaftClusterMember>.ReceiveResignAsync(CancellationToken)
RaftCluster<RaftClusterMember>.ICluster.ResignAsync(CancellationToken)
RaftCluster<RaftClusterMember>.ReceiveResign()
RaftCluster<RaftClusterMember>.ForceReplicationAsync(TimeSpan, CancellationToken)
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 class RaftCluster : RaftCluster<RaftClusterMember>, IDisposable, IRaftCluster, IReplicationCluster<IRaftLogEntry>, IReplicationCluster, ICluster, IRaftStateMachine, ILocalMember

Constructors

| Improve this Doc View Source

RaftCluster(RaftCluster.NodeConfiguration)

Initializes a new default implementation of Raft-based cluster.

Declaration
public RaftCluster(RaftCluster.NodeConfiguration configuration)
Parameters
Type Name Description
RaftCluster.NodeConfiguration configuration

The configuration of the cluster.

Methods

| Improve this Doc View Source

CreateClient(IPEndPoint)

Initializes a new client for communication with cluster member.

Declaration
protected RaftClusterMember CreateClient(IPEndPoint address)
Parameters
Type Name Description
IPEndPoint address

The address of the cluster member.

Returns
Type Description
RaftClusterMember

A new client for communication with cluster member.

Remarks

This method is needed if you want to implement dynamic addition of the new cluster members.

| Improve this Doc View Source

Dispose(Boolean)

Releases managed and unmanaged resources associated with this object.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

true if called from Dispose(); false if called from finalizer Finalize().

Overrides
DotNext.Net.Cluster.Consensus.Raft.RaftCluster<DotNext.Net.Cluster.Consensus.Raft.RaftClusterMember>.Dispose(System.Boolean)
| Improve this Doc View Source

StartAsync(CancellationToken)

Starts serving local member.

Declaration
public override Task StartAsync(CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
CancellationToken token

The token that can be used to cancel initialization process.

Returns
Type Description
Task

The task representing asynchronous execution of the method.

Overrides
DotNext.Net.Cluster.Consensus.Raft.RaftCluster<DotNext.Net.Cluster.Consensus.Raft.RaftClusterMember>.StartAsync(System.Threading.CancellationToken)
| Improve this Doc View Source

StopAsync(CancellationToken)

Stops serving local member.

Declaration
public override Task StopAsync(CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
CancellationToken token

The token that can be used to cancel shutdown process.

Returns
Type Description
Task

The task representing asynchronous execution of the method.

Overrides
DotNext.Net.Cluster.Consensus.Raft.RaftCluster<DotNext.Net.Cluster.Consensus.Raft.RaftClusterMember>.StopAsync(System.Threading.CancellationToken)

Implements

System.IDisposable
IRaftCluster
IReplicationCluster<TEntry>
IReplicationCluster
ICluster

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