IDurableLog<T>
Namespace: Orleans.Durable.Journaling
public interface IDurableLog<T> : IEnumerable<T>, IReadOnlyCollection<T>, IEnumerableRemarks
Each appended entry receives the next value of a durable, monotonically increasing sequence number. Sequence numbers are never reused within a history: Orleans.Durable.Journaling.IDurableLog.TrimBefore discards old entries while preserving the sequence, and Orleans.Durable.Journaling.IDurableLog.Clear replaces the log's entries after consuming one sequence number. Enumeration yields the retained entries in sequence order.
Orleans.Durable.Journaling.IDurableLog.Epoch identifies the history. Deleting the journal ends the history and restarts the sequence, and the next change begins a history with a new epoch. A reader position is therefore an epoch and a sequence number.
A draft streams volatile content to readers which include drafts before its durable entries exist. Use drafts for incremental output, such as model responses, whose final form is committed as one or more entries.
Orleans.Durable.Journaling.IDurableLog.Seal durably ends the log, so that readers' streams end after its final entry.
The log takes ownership of the entries and draft items passed to it, and the journal records each entry when it is appended. To change an entry's content, append a new entry.
Properties
CommittedSequenceGets the sequence number after the last committed entry. Entries with lower sequence numbers are durable.EpochGets the identifier of the log's history, or zero when the log has no history.FirstSequenceGets the sequence number of the first retained entry.IsSealedGets a value indicating whetherOrleans.Durable.Journaling.IDurableLog.Sealhas ended the log.NextSequenceGets the sequence number which the next appended entry receives.
Methods
Append(T)Appends an entry to the log.BeginDraftOpens a draft which streams volatile items to readers which include drafts.ClearDiscards every entry, such as to replace the discarded entries with a compacted summary.ReadAsync(long, long, bool, LogDraftId?, CancellationToken)Reads the log's committed entries from a position, then waits for new entries.SealDurably ends the log.TrimBefore(long)Discards entries with sequence numbers lower thansequence.TryGet(long, T)Attempts to get the retained entry with the specified sequence number.
Indexers
this[long]Gets the retained entry with the specified sequence number.
