Show / Hide Table of Contents

Class RaftClusterMember

Represents Raft cluster member that is accessible through the network.

Inheritance
object
Disposable
RaftClusterMember
Implements
IDisposable
IRaftClusterMember
IClusterMember
IPeer
Inherited Members
Disposable.CreateException()
Disposable.GetDisposedTask<T>()
Disposable.TrySetDisposedException<T>(TaskCompletionSource<T>)
Disposable.TrySetDisposedException(TaskCompletionSource)
Disposable.Dispose(bool)
Disposable.DisposeAsyncCore()
Disposable.DisposeAsync()
Disposable.TryBeginDispose()
Disposable.Dispose()
Disposable.Dispose(IEnumerable<IDisposable>)
Disposable.DisposeAsync(params IEnumerable<IAsyncDisposable>)
Disposable.Dispose<TDisposable>(params ReadOnlySpan<TDisposable>)
Disposable.IsDisposed
Disposable.IsDisposing
Disposable.IsDisposingOrDisposed
Disposable.DisposedTask
object.GetType()
object.MemberwiseClone()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Net.Cluster.Consensus.Raft
Assembly: DotNext.Net.Cluster.dll
Syntax
public abstract class RaftClusterMember : Disposable, IDisposable, IRaftClusterMember, IClusterMember, IPeer

Properties

View Source

EndPoint

Gets the address of this cluster member.

Declaration
public EndPoint EndPoint { get; }
Property Value
Type Description
EndPoint
View Source

IsLeader

Determines whether this member is a leader.

Declaration
public bool IsLeader { get; }
Property Value
Type Description
bool
View Source

IsRemote

Determines whether this member is not a local node.

Declaration
public bool IsRemote { get; }
Property Value
Type Description
bool
View Source

Status

Gets the status of this member.

Declaration
public ClusterMemberStatus Status { get; }
Property Value
Type Description
ClusterMemberStatus

Methods

View Source

CancelPendingRequestsAsync()

Cancels pending requests scheduled for this member.

Declaration
public abstract ValueTask CancelPendingRequestsAsync()
Returns
Type Description
ValueTask

The task representing asynchronous execution of this method.

View Source

GetMetadataAsync(bool, CancellationToken)

Obtains metadata associated with this member.

Declaration
public ValueTask<IReadOnlyDictionary<string, string>> GetMetadataAsync(bool refresh, CancellationToken token)
Parameters
Type Name Description
bool refresh

true to make a network request to the member and update local cache; false to obtain cached metadata.

CancellationToken token

The token that can be used to cancel operation.

Returns
Type Description
ValueTask<IReadOnlyDictionary<string, string>>

The task representing metadata read operation.

Remarks

This method is completed synchronously is most cases if refresh is false.

Exceptions
Type Condition
MemberUnavailableException

This member is not reachable through the network.

View Source

ResignAsync(CancellationToken)

Revokes leadership.

Declaration
public abstract Task<bool> ResignAsync(CancellationToken token)
Parameters
Type Name Description
CancellationToken token

The token that can be used to cancel asynchronous operation.

Returns
Type Description
Task<bool>

true, if leadership is revoked successfully; otherwise, false.

Exceptions
Type Condition
MemberUnavailableException

This member is not reachable through the network.

View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
View Source

TryGetMetadata()

Tries to get cached metadata.

Declaration
public IReadOnlyDictionary<string, string>? TryGetMetadata()
Returns
Type Description
IReadOnlyDictionary<string, string>

The cached metadata; or null if it's not available.

Events

View Source

MemberStatusChanged

Informs about status change.

Declaration
public event Action<ClusterMemberStatusChangedEventArgs<RaftClusterMember>> MemberStatusChanged
Event Type
Type Description
Action<ClusterMemberStatusChangedEventArgs<RaftClusterMember>>

Implements

IDisposable
IRaftClusterMember
IClusterMember
IPeer

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾