Skip to main content

IRecomputeJobStore

Namespace: Meshmakers.Octo.Runtime.Contracts.StreamData

Persists the RecomputeJob history (AB#4184): one entity per recompute run, queryable per archive so an operator can debug why a recompute failed. Separate from IArchiveRecomputeStateStore because jobs are their own prunable entities, not attributes on the archive.

public interface IRecomputeJobStore

Methods

CreateAsync(RecomputeJobSnapshot)

Persists a new job (its RecomputeJobSnapshot.RtId is ignored) and returns the assigned runtime id.

Task<OctoObjectId> CreateAsync(RecomputeJobSnapshot job)

Parameters

job RecomputeJobSnapshot

Returns

Task<OctoObjectId>

UpdateAsync(RecomputeJobSnapshot)

Overwrites the stored job identified by RecomputeJobSnapshot.RtId with the given state — used to advance Pending → Running → Swapping → Completed/Failed and to record counts, timings, and the failure reason.

Task UpdateAsync(RecomputeJobSnapshot job)

Parameters

job RecomputeJobSnapshot

Returns

Task

GetAsync(OctoObjectId)

Reads a single job by id, or null if it does not exist.

Task<RecomputeJobSnapshot> GetAsync(OctoObjectId jobRtId)

Parameters

jobRtId OctoObjectId

Returns

Task<RecomputeJobSnapshot>

GetForArchiveAsync(OctoObjectId, Int32)

Returns the most recent jobs for an archive, newest first, capped at . Backs the recomputeJobsFor(archiveRtId) query.

Task<IReadOnlyList<RecomputeJobSnapshot>> GetForArchiveAsync(OctoObjectId archiveRtId, int limit)

Parameters

archiveRtId OctoObjectId

limit Int32

Returns

Task<IReadOnlyList<RecomputeJobSnapshot>>

GetActiveForArchiveAsync(OctoObjectId)

Returns the single non-terminal job (Pending / Running / Swapping) for an archive, or null if none is active. Used by the coalesce policy to fold a new trigger into an already-running job instead of starting a second one.

Task<RecomputeJobSnapshot> GetActiveForArchiveAsync(OctoObjectId archiveRtId)

Parameters

archiveRtId OctoObjectId

Returns

Task<RecomputeJobSnapshot>