Skip to content

IDurableLog<T>

interface

Namespace: Orleans.Durable.Journaling

Represents an append-only, observable log whose entries are recorded in a journal.
public interface IDurableLog<T> : IEnumerable<T>, IReadOnlyCollection<T>, IEnumerable

Remarks

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

  • CommittedSequence Gets the sequence number after the last committed entry. Entries with lower sequence numbers are durable.
  • Epoch Gets the identifier of the log's history, or zero when the log has no history.
  • FirstSequence Gets the sequence number of the first retained entry.
  • IsSealed Gets a value indicating whether Orleans.Durable.Journaling.IDurableLog.Seal has ended the log.
  • NextSequence Gets the sequence number which the next appended entry receives.

Methods

Indexers

  • this[long] Gets the retained entry with the specified sequence number.