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.CreateException()
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(params IEnumerable<IAsyncDisposable>)
Disposable.Dispose<TDisposable>(params ReadOnlySpan<TDisposable>)
Disposable.IsDisposed
Disposable.IsDisposing
Disposable.IsDisposingOrDisposed
Disposable.DisposedTask
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
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.

Properties

View Source

Comparer

Gets the comparer of the address.

Declaration
protected virtual IEqualityComparer<TAddress> Comparer { get; }
Property Value
Type Description
IEqualityComparer<TAddress>
View Source

MemoryAllocator

Gets or sets memory allocator.

Declaration
public MemoryAllocator<byte> MemoryAllocator { get; init; }
Property Value
Type Description
MemoryAllocator<byte>

Methods

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.

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)
View Source

Encode(TAddress, ref BufferWriterSlim<byte>)

Encodes the address to its binary representation.

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

The address to encode.

BufferWriterSlim<byte> writer

The buffer for the address.

View Source

LoadConfigurationAsync(CancellationToken)

Loads the configuration from the storage.

Declaration
protected abstract ValueTask<(MemoryOwner<byte> Configuration, long Version)> LoadConfigurationAsync(CancellationToken token)
Parameters
Type Name Description
CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<(MemoryOwner<byte> Configuration, long Version)>

The memory block representing the cluster configuration.

View Source

SaveConfigurationAsync(ReadOnlyMemory<byte>, long, CancellationToken)

Stores the configuration.

Declaration
protected abstract ValueTask<bool> SaveConfigurationAsync(ReadOnlyMemory<byte> configuration, long configurationVersion, CancellationToken token)
Parameters
Type Name Description
ReadOnlyMemory<byte> configuration

The memory block representing the cluster configuration.

long configurationVersion

The version of the configuration.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<bool>

The task representing asynchronous result.

Events

View Source

ConfigurationChanged

An event occurred when the configuration is changed.

Declaration
public event Func<IClusterConfiguration<TAddress>, CancellationToken, ValueTask> ConfigurationChanged
Event Type
Type Description
Func<IClusterConfiguration<TAddress>, CancellationToken, ValueTask>

Implements

IClusterConfigurationStorage<TAddress>
IClusterConfigurationStorage
IDisposable

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