Show / Hide Table of Contents

Class ClusterConfigurationStorage<TAddress>

Represents base class for all implementations of cluster configuration storages.

Inheritance
object
Disposable
ClusterConfigurationStorage<TAddress>
InMemoryClusterConfigurationStorage<TAddress>
PersistentClusterConfigurationStorage<TAddress>
Implements
IClusterConfigurationStorage<TAddress>
IClusterConfigurationStorage
IDisposable
Inherited Members
Disposable.IsDisposed
Disposable.IsDisposing
Disposable.IsDisposingOrDisposed
Disposable.CreateException()
Disposable.DisposedTask
Disposable.GetDisposedTask<T>()
Disposable.TrySetDisposedException<T>(TaskCompletionSource<T>)
Disposable.TrySetDisposedException(TaskCompletionSource)
Disposable.DisposeAsyncCore()
Disposable.DisposeAsync()
Disposable.TryBeginDispose()
Disposable.Dispose()
Disposable.Dispose(IEnumerable<IDisposable>)
Disposable.DisposeAsync(IEnumerable<IAsyncDisposable>)
Disposable.Dispose<T>(ReadOnlySpan<T>)
Disposable.DisposeAsync(params 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.Membership
Assembly: DotNext.Net.Cluster.dll
Syntax
public abstract class ClusterConfigurationStorage<TAddress> : Disposable, IClusterConfigurationStorage<TAddress>, IClusterConfigurationStorage, IDisposable where TAddress : notnull
Type Parameters
Name Description
TAddress

The type of the cluster member address.

Fields

| Edit this page View Source

allocator

The memory allocator.

Declaration
protected readonly MemoryAllocator<byte>? allocator
Field Value
Type Description
MemoryAllocator<byte>

Properties

| Edit this page View Source

ActiveConfiguration

Represents active cluster configuration maintained by the node.

Declaration
public abstract IClusterConfiguration ActiveConfiguration { get; }
Property Value
Type Description
IClusterConfiguration
| Edit this page View Source

HasProposal

Gets a value indicating that this storage has proposed configuration.

Declaration
public abstract bool HasProposal { get; }
Property Value
Type Description
bool
| Edit this page View Source

ProposedConfiguration

Represents proposed cluster configuration.

Declaration
public abstract IClusterConfiguration? ProposedConfiguration { get; }
Property Value
Type Description
IClusterConfiguration

Methods

| Edit this page View Source

AddMemberAsync(TAddress, CancellationToken)

Proposes a new member.

Declaration
protected abstract ValueTask<bool> AddMemberAsync(TAddress address, CancellationToken token = default)
Parameters
Type Name Description
TAddress address

The address of the cluster member.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<bool>

true if the new member is added to the proposed configuration; false if the storage has the proposed configuration already.

| Edit this page View Source

ApplyAsync(CancellationToken)

Applies proposed configuration as active configuration.

Declaration
protected abstract ValueTask ApplyAsync(CancellationToken token = default)
Parameters
Type Name Description
CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask

The task representing asynchronous result.

| Edit this page View Source

Decode(ref SequenceReader)

Decodes the address of the node from its binary representation.

Declaration
protected abstract TAddress Decode(ref SequenceReader reader)
Parameters
Type Name Description
SequenceReader reader

The reader of binary data.

Returns
Type Description
TAddress

The decoded address.

| Edit this page View Source

Dispose(bool)

Releases managed and unmanaged resources associated with this object.

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

true if called from Dispose(); false if called from finalizer ~Disposable().

Overrides
Disposable.Dispose(bool)
| Edit this page View Source

Encode(TAddress, ref BufferWriterSlim<byte>)

Encodes the address to its binary representation.

Declaration
protected abstract void Encode(TAddress address, ref BufferWriterSlim<byte> output)
Parameters
Type Name Description
TAddress address

The address to encode.

BufferWriterSlim<byte> output

The buffer for the address.

| Edit this page View Source

LoadConfigurationAsync(CancellationToken)

Loads configuration from the storage.

Declaration
protected abstract ValueTask LoadConfigurationAsync(CancellationToken token = default)
Parameters
Type Name Description
CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask

The task representing asynchronous result.

| Edit this page View Source

ProposeAsync(IClusterConfiguration, CancellationToken)

Proposes the configuration.

Declaration
protected abstract ValueTask ProposeAsync(IClusterConfiguration configuration, CancellationToken token = default)
Parameters
Type Name Description
IClusterConfiguration configuration

The proposed configuration.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask

The task representing asynchronous result.

Remarks

If method is called multiple times then ProposedConfiguration will be rewritten.

| Edit this page View Source

RemoveMemberAsync(TAddress, CancellationToken)

Proposes removal of the existing member.

Declaration
protected abstract ValueTask<bool> RemoveMemberAsync(TAddress address, CancellationToken token = default)
Parameters
Type Name Description
TAddress address

The address of the cluster member.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<bool>

true if the new member is added to the proposed configuration; false if the storage has the proposed configuration already.

Events

| Edit this page View Source

ActiveConfigurationChanged

An event occurred when proposed configuration is applied.

Declaration
public event Func<TAddress, bool, CancellationToken, ValueTask> ActiveConfigurationChanged
Event Type
Type Description
Func<TAddress, bool, CancellationToken, ValueTask>

Implements

IClusterConfigurationStorage<TAddress>
IClusterConfigurationStorage
IDisposable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾