Show / Hide Table of Contents

Class PersistentClusterConfigurationStorage<TAddress>

Represents persistent cluster configuration storage.

Inheritance
object
Disposable
ClusterConfigurationStorage<TAddress>
PersistentClusterConfigurationStorage<TAddress>
Implements
IClusterConfigurationStorage<TAddress>
IClusterConfigurationStorage
IDisposable
IAsyncDisposable
Inherited Members
ClusterConfigurationStorage<TAddress>.allocator
ClusterConfigurationStorage<TAddress>.Encode(TAddress, ref BufferWriterSlim<byte>)
ClusterConfigurationStorage<TAddress>.Decode(ref SequenceReader)
ClusterConfigurationStorage<TAddress>.ActiveConfigurationChanged
Disposable.IsDisposed
Disposable.IsDisposing
Disposable.IsDisposingOrDisposed
Disposable.CreateException()
Disposable.DisposedTask
Disposable.GetDisposedTask<T>()
Disposable.TrySetDisposedException<T>(TaskCompletionSource<T>)
Disposable.TrySetDisposedException(TaskCompletionSource)
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 PersistentClusterConfigurationStorage<TAddress> : ClusterConfigurationStorage<TAddress>, IClusterConfigurationStorage<TAddress>, IClusterConfigurationStorage, IDisposable, IAsyncDisposable where TAddress : notnull
Type Parameters
Name Description
TAddress

The type of the cluster member address.

Constructors

| Edit this page View Source

PersistentClusterConfigurationStorage(string, int, IEqualityComparer<TAddress>?, MemoryAllocator<byte>?)

Initializes a new persistent storage.

Declaration
protected PersistentClusterConfigurationStorage(string path, int fileBufferSize = 512, IEqualityComparer<TAddress>? comparer = null, MemoryAllocator<byte>? allocator = null)
Parameters
Type Name Description
string path

The full path to the folder used as persistent storage of cluster members.

int fileBufferSize

The buffer size for file I/O.

IEqualityComparer<TAddress> comparer

The address comparer.

MemoryAllocator<byte> allocator

The memory allocator for file I/O.

Properties

| Edit this page View Source

ActiveConfiguration

Gets active configuration.

Declaration
public override sealed IClusterConfiguration ActiveConfiguration { get; }
Property Value
Type Description
IClusterConfiguration
Overrides
ClusterConfigurationStorage<TAddress>.ActiveConfiguration
| Edit this page View Source

HasProposal

Gets a value indicating that this storage has proposed configuration.

Declaration
public override sealed bool HasProposal { get; }
Property Value
Type Description
bool
Overrides
ClusterConfigurationStorage<TAddress>.HasProposal
| Edit this page View Source

ProposedConfiguration

Gets proposed configuration.

Declaration
public override sealed IClusterConfiguration? ProposedConfiguration { get; }
Property Value
Type Description
IClusterConfiguration
Overrides
ClusterConfigurationStorage<TAddress>.ProposedConfiguration

Methods

| Edit this page View Source

AddMemberAsync(TAddress, CancellationToken)

Proposes a new member.

Declaration
protected override sealed 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.

Overrides
ClusterConfigurationStorage<TAddress>.AddMemberAsync(TAddress, CancellationToken)
| Edit this page View Source

ApplyAsync(CancellationToken)

Applies proposed configuration as active configuration.

Declaration
protected override sealed 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.

Overrides
ClusterConfigurationStorage<TAddress>.ApplyAsync(CancellationToken)
| 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
ClusterConfigurationStorage<TAddress>.Dispose(bool)
| Edit this page View Source

DisposeAsync()

Releases managed resources associated with this object.

Declaration
public ValueTask DisposeAsync()
Returns
Type Description
ValueTask

The task representing asynchronous result.

| Edit this page View Source

DisposeAsyncCore()

Releases managed resources associated with this object asynchronously.

Declaration
protected override ValueTask DisposeAsyncCore()
Returns
Type Description
ValueTask

The task representing asynchronous execution of this method.

Overrides
Disposable.DisposeAsyncCore()
Remarks

This method makes sense only if derived class implements IAsyncDisposable interface.

| Edit this page View Source

LoadConfigurationAsync(CancellationToken)

Loads configuration from the storage.

Declaration
protected override sealed 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.

Overrides
ClusterConfigurationStorage<TAddress>.LoadConfigurationAsync(CancellationToken)
| Edit this page View Source

ProposeAsync(IClusterConfiguration, CancellationToken)

Proposes the configuration.

Declaration
protected override sealed 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.

Overrides
ClusterConfigurationStorage<TAddress>.ProposeAsync(IClusterConfiguration, CancellationToken)
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 override sealed 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.

Overrides
ClusterConfigurationStorage<TAddress>.RemoveMemberAsync(TAddress, CancellationToken)

Implements

IClusterConfigurationStorage<TAddress>
IClusterConfigurationStorage
IDisposable
IAsyncDisposable

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
☀
☾