Class InMemoryClusterConfigurationStorage<TAddress>
Represents in-memory storage of cluster configuration.
Inherited Members
Namespace: DotNext.Net.Cluster.Consensus.Raft.Membership
Assembly: DotNext.Net.Cluster.dll
Syntax
public abstract class InMemoryClusterConfigurationStorage<TAddress> : ClusterConfigurationStorage<TAddress>, IClusterConfigurationStorage<TAddress>, IClusterConfigurationStorage, IDisposable where TAddress : notnull
Type Parameters
| Name | Description |
|---|---|
| TAddress | The type of cluster member address. |
Constructors
View SourceInMemoryClusterConfigurationStorage()
Initializes a new in-memory configuration storage.
Declaration
protected InMemoryClusterConfigurationStorage()
Methods
View SourceCreateInitialConfigurationBuilder()
Creates a builder of the initial configuration.
Declaration
public InMemoryClusterConfigurationStorage<TAddress>.Builder CreateInitialConfigurationBuilder()
Returns
| Type | Description |
|---|---|
| InMemoryClusterConfigurationStorage<TAddress>.Builder | The builder instance. |
LoadConfigurationAsync(CancellationToken)
Loads the configuration from the storage.
Declaration
protected override sealed 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. |
Overrides
View SourceSaveConfigurationAsync(ReadOnlyMemory<byte>, long, CancellationToken)
Stores the configuration.
Declaration
protected override sealed 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. |