Table of Contents

Interface ITransitionLogStore

Namespace
Foundation.Data.Doublets.Cli
Assembly
Foundation.Data.Doublets.Cli.dll

Append-only store of serialized transitions and recovery markers: the journal of TransactionsDecorator<TLinkAddress>.

public interface ITransitionLogStore

Remarks

Two implementations ship with the library: the original links-backed journal, where each entry is the name of a fresh link (used by the constructors that take an INamedTypesLinks<TLinkAddress>), and FileTransitionLog, an append-only text file whose size retention policies bound (issue #195).

Properties

SupportsCompaction

Whether CompactLogEntries(IReadOnlyList<string>) can rewrite the durable journal. Retention uses it to bound the journal on disk; logs without it keep every entry, as before.

bool SupportsCompaction { get; }

Property Value

bool

SupportsDurableFlush

Whether FlushLog() requests persistent storage. This describes the adapter, not the reliability of its hardware.

bool SupportsDurableFlush { get; }

Property Value

bool

Methods

AppendLogEntry(string)

Appends one entry. Entries never contain line breaks.

void AppendLogEntry(string entry)

Parameters

entry string

CompactLogEntries(IReadOnlyList<string>)

Atomically and durably replaces every entry with entries, the retained journal. After a crash the log holds either the old or the new journal, never a mixture. Called only between transactions and only when SupportsCompaction is true.

void CompactLogEntries(IReadOnlyList<string> entries)

Parameters

entries IReadOnlyList<string>

FlushLog()

Makes every appended entry durable.

void FlushLog()

ReadLogEntries()

Reads every entry back, oldest first.

IReadOnlyList<string> ReadLogEntries()

Returns

IReadOnlyList<string>