Zum Hauptinhalt springen

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

UpdatePendingRecomputeRangesAsync(OctoObjectId, IReadOnlyList<ArchiveRecomputeRange>, IReadOnlyList<ArchiveRecomputeRange>)​

Applies one delta to the pending recompute-range work list in a single write (AB#5189): every stored obligation equal to one of remove is taken out, then add is appended. Either list may be empty.

Task UpdatePendingRecomputeRangesAsync(OctoObjectId archiveRtId, IReadOnlyList<ArchiveRecomputeRange> remove, IReadOnlyList<ArchiveRecomputeRange> add)

Parameters​

archiveRtId OctoObjectId

remove IReadOnlyList<ArchiveRecomputeRange>

add IReadOnlyList<ArchiveRecomputeRange>

Returns​

Task

Remarks:

The drain leaves the obligations it is working on in the list while the run is in progress and only removes them here, once the run has committed — so a process that dies mid-run leaves its work exactly where it was, and the next drain picks it up. Removing and re-adding in one write keeps a failure's remainder from ever being absent from the list.

Removal is by value (record equality): the caller hands back the very records it read. An obligation appended concurrently — a manual trigger coalesced into the running job — has a later ArchiveRecomputeRange.EnqueuedAt, is not equal, and survives.

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