Skip to content

IJournaledState Methods

Interface for a state which can be persisted to durable storage.

AppendEntries(JournalStreamWriter)

abstract
public abstract void AppendEntries(JournalStreamWriter writer)
Writes pending state changes to the journal.

Parameters

writerJournalStreamWriter
The journal stream writer.

AppendSnapshot(JournalStreamWriter)

abstract
public abstract void AppendSnapshot(JournalStreamWriter writer)
Writes a snapshot of the state to the provided writer.

Parameters

writerJournalStreamWriter
The journal stream writer.

DeepCopy

abstract
public abstract IJournaledState DeepCopy()
Creates and returns a deep copy of this instance. All replicas must be independent such that changes to one do not affect any other.

Returns

A replica of this instance.

OnRecoveryCompleted

virtual
View source
public virtual void OnRecoveryCompleted()
Notifies the state that all prior journal entries and snapshots have been applied.

OnWriteCompleted

virtual
View source
public virtual void OnWriteCompleted()
Notifies the state that all prior journal entries and snapshots which it has written have been written to stable storage.

ReplayEntry(JournalEntry, JournalReplayContext)

abstract
public abstract void ReplayEntry(JournalEntry entry, JournalReplayContext context)
Replays one entry during journal recovery.

Parameters

entryJournalEntry
The entry to replay.
contextJournalReplayContext
The replay context.

Reset(JournalStreamWriter)

abstract
public abstract void Reset(JournalStreamWriter writer)
Resets the state.

Parameters

writerJournalStreamWriter