Class PersistentClusterConfigurationStorage<TAddress>
Represents persistent cluster configuration storage.
Inherited Members
Namespace: DotNext.Net.Cluster.Consensus.Raft.Membership
Assembly: DotNext.Net.Cluster.dll
Syntax
public abstract class PersistentClusterConfigurationStorage<TAddress> : ClusterConfigurationStorage<TAddress>, IClusterConfigurationStorage<TAddress>, IClusterConfigurationStorage, IDisposable where TAddress : notnull
Type Parameters
| Name | Description |
|---|---|
| TAddress | The type of the cluster member address. |
Constructors
View SourcePersistentClusterConfigurationStorage(string)
Initializes a new persistent storage.
Declaration
protected PersistentClusterConfigurationStorage(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fileName | The full path to the file used as persistent storage of cluster members. |
Methods
View SourceLoadConfigurationAsync(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. |