Skip to content

PrimaryBasedLogViewAdaptor<TLogView, TLogEntry, TSubmissionEntry>

class

Namespace: Orleans.EventSourcing.Common

A general template for constructing log view adaptors that are based on a sequentially read and written primary. We use this to construct a variety of different log-consistency providers, all following the same basic pattern (read and write latest view from/to primary, and send notifications after writing).

Note that the log itself is transient, i.e. not actually saved to storage - only the latest view and some metadata (the log position, and write flags) is stored in the primary. It is safe to interleave calls to this adaptor (using grain scheduler only, of course).

Subclasses override ReadAsync and WriteAsync to read from / write to primary. Calls to the primary are serialized, i.e. never interleave.

public abstract class PrimaryBasedLogViewAdaptor<TLogView, TLogEntry, TSubmissionEntry> : ILogConsistencyDiagnostics, ILogViewAdaptor<TLogView, TLogEntry>, ILogViewRead<TLogView, TLogEntry>, ILogViewUpdate<TLogEntry>
where TLogView : class, new()
where TLogEntry : class
where TSubmissionEntry : Orleans.EventSourcing.Common.SubmissionEntry<TLogEntry>

Properties

  • ConfirmedVersion The length of the confirmed prefix of the log
  • ConfirmedView Confirmed view of the log (reflecting only confirmed entries)
  • TentativeView Local, tentative view of the log (reflecting both confirmed and unconfirmed entries)
  • UnconfirmedSuffix A list of the submitted entries that do not yet appear in the confirmed prefix.

Methods