Struct BufferedLogEntryList
Represents log entry producer that allows to bufferize log entries from another producer.
Implements
Inherited Members
Namespace: DotNext.Net.Cluster.Consensus.Raft
Assembly: DotNext.Net.Cluster.dll
Syntax
public readonly struct BufferedLogEntryList : IDisposable, IReadOnlyList<BufferedLogEntry>, IReadOnlyCollection<BufferedLogEntry>, IEnumerable<BufferedLogEntry>, IEnumerable
Remarks
This type is intended for developing transport-layer buffering and low level I/O optimizations when writing custom Write-Ahead Log. It's not recommended to use the type in the application code.
Properties
| Edit this page View SourceCount
Gets the number of buffered log entries.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
this[int]
Gets buffered log entry by the index.
Declaration
public ref readonly BufferedLogEntry this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the log entry. |
Property Value
Type | Description |
---|---|
BufferedLogEntry |
Methods
| Edit this page View SourceCopyAsync<TEntry>(ILogEntryProducer<TEntry>, LogEntriesBufferingOptions, CancellationToken)
Constructs bufferized copy of all log entries presented in the sequence.
Declaration
public static Task<BufferedLogEntryList> CopyAsync<TEntry>(ILogEntryProducer<TEntry> producer, LogEntriesBufferingOptions options, CancellationToken token = default) where TEntry : notnull, IRaftLogEntry
Parameters
Type | Name | Description |
---|---|---|
ILogEntryProducer<TEntry> | producer | The sequence of log entries to be copied. |
LogEntriesBufferingOptions | options | Buffering options. |
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
Task<BufferedLogEntryList> | The copy of the log entries. |
Type Parameters
Name | Description |
---|---|
TEntry | The type of the entry in the source sequence. |
Exceptions
Type | Condition |
---|---|
OperationCanceledException | The operation has been canceled. |
CopyAsync<TEntry, TList>(TList, LogEntriesBufferingOptions, CancellationToken)
Constructs bufferized copy of all log entries presented in the list.
Declaration
public static Task<BufferedLogEntryList> CopyAsync<TEntry, TList>(TList list, LogEntriesBufferingOptions options, CancellationToken token = default) where TEntry : notnull, IRaftLogEntry where TList : notnull, IReadOnlyList<TEntry>
Parameters
Type | Name | Description |
---|---|---|
TList | list | The list of log entries to be copied. |
LogEntriesBufferingOptions | options | Buffering options. |
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
Task<BufferedLogEntryList> | The copy of the log entries. |
Type Parameters
Name | Description |
---|---|
TEntry | The type of the entry in the source sequence. |
TList | The type of the list of log entries. |
Exceptions
Type | Condition |
---|---|
OperationCanceledException | The operation has been canceled. |
Dispose()
Releases all buffered log entries.
Declaration
public void Dispose()
ToProducer()
Creates asynchronous log entry producer from this list.
Declaration
public ILogEntryProducer<BufferedLogEntry> ToProducer()
Returns
Type | Description |
---|---|
ILogEntryProducer<BufferedLogEntry> | The entry producer. |