Skip to main content

IArchiveRecomputeStateStore

Namespace: Meshmakers.Octo.Runtime.Contracts.StreamData

Persists the per-archive recompute state (AB#4184) that lives on the archive entity itself: the dirty-window ledger (Information A), the pending recompute-range work list (Information B), and the observability fields (in-progress flag, last success / failure). Backed by the archive entity's runtime-state attributes so a blueprint re-apply never resets it.

public interface IArchiveRecomputeStateStore

Remarks:

Operations target raw, time-range, and rollup archives alike (a rollup is itself a source for chained rollups). Implementations load the archive entity, mutate the relevant runtime-state attribute(s), and persist — mirroring how the watermark / freeze attributes are maintained today.

Methods

AppendDirtyWindowAsync(OctoObjectId, ArchiveDirtyWindow)

Appends a retroactive-change record (Information A) to the archive's dirty-window ledger. Append-style changes that do not make dependents stale need not be recorded.

Task AppendDirtyWindowAsync(OctoObjectId archiveRtId, ArchiveDirtyWindow window)

Parameters

archiveRtId OctoObjectId

window ArchiveDirtyWindow

Returns

Task

GetDirtyWindowsAsync(OctoObjectId)

Reads the archive's current dirty-window ledger; empty when clean.

Task<IReadOnlyList<ArchiveDirtyWindow>> GetDirtyWindowsAsync(OctoObjectId archiveRtId)

Parameters

archiveRtId OctoObjectId

Returns

Task<IReadOnlyList<ArchiveDirtyWindow>>

ClearDirtyWindowsAsync(OctoObjectId)

Clears the dirty-window ledger after the orchestrator has translated it into pending recompute ranges on the dependents.

Task ClearDirtyWindowsAsync(OctoObjectId archiveRtId)

Parameters

archiveRtId OctoObjectId

Returns

Task

EnqueueRecomputeRangesAsync(OctoObjectId, IReadOnlyList<ArchiveRecomputeRange>)

Appends pending recompute obligations (Information B) to the archive's work list, coalescing is the caller's concern (see RecomputePlanner.MergeIntervals).

Task EnqueueRecomputeRangesAsync(OctoObjectId archiveRtId, IReadOnlyList<ArchiveRecomputeRange> ranges)

Parameters

archiveRtId OctoObjectId

ranges IReadOnlyList<ArchiveRecomputeRange>

Returns

Task

GetPendingRecomputeRangesAsync(OctoObjectId)

Reads the archive's pending recompute-range work list; empty when nothing is due.

Task<IReadOnlyList<ArchiveRecomputeRange>> GetPendingRecomputeRangesAsync(OctoObjectId archiveRtId)

Parameters

archiveRtId OctoObjectId

Returns

Task<IReadOnlyList<ArchiveRecomputeRange>>

ClearPendingRecomputeRangesAsync(OctoObjectId)

Clears the pending recompute-range work list after the ranges have been processed.

Task ClearPendingRecomputeRangesAsync(OctoObjectId archiveRtId)

Parameters

archiveRtId OctoObjectId

Returns

Task

MarkRecomputeStartedAsync(OctoObjectId, DateTime)

Sets RecomputeInProgress = true and stamps LastRecomputeStartedAt. Called when a recompute job for the archive starts.

Task MarkRecomputeStartedAsync(OctoObjectId archiveRtId, DateTime startedAt)

Parameters

archiveRtId OctoObjectId

startedAt DateTime

Returns

Task

MarkRecomputeSucceededAsync(OctoObjectId, DateTime)

Clears RecomputeInProgress and stamps LastRecomputeSuccessAt after a successful commit.

Task MarkRecomputeSucceededAsync(OctoObjectId archiveRtId, DateTime succeededAt)

Parameters

archiveRtId OctoObjectId

succeededAt DateTime

Returns

Task

MarkRecomputeFailedAsync(OctoObjectId, DateTime, String)

Clears RecomputeInProgress, stamps LastRecomputeFailureAt and records LastRecomputeFailureReason so a failed run is debuggable.

Task MarkRecomputeFailedAsync(OctoObjectId archiveRtId, DateTime failedAt, string reason)

Parameters

archiveRtId OctoObjectId

failedAt DateTime

reason String

Returns

Task