ITimeRangeArchiveRuntimeStore
Namespace: Meshmakers.Octo.Runtime.Contracts.StreamData
Persistence operations for TimeRangeArchive entities. Mirrors
IArchiveRuntimeStore for the time-range-specific subtype: read/get the
archive's metadata snapshot and the soft-delete entry point. There is no InsertAsync
counterpart on this store — data inserts go through
IStreamDataRepository.InsertTimeRangeAsync(OctoObjectId, IEnumerable<TimeRangeStreamDataPoint>, CancellationToken) directly (CrateDB writes), not via
Mongo. The store is the Mongo side: schema definition, status transitions (inherited from
the archive lifecycle), soft-delete.
public interface ITimeRangeArchiveRuntimeStore
Remarks:
Concept doc: docs/concept-time-range-archives.md §3, §4. Time-range archives have no
orchestrator and no source-archive coupling, so the interface is intentionally smaller
than IRollupArchiveRuntimeStore.
Methods
GetAsync(OctoObjectId)
Returns the snapshot of the time-range archive identified by ,
or null if no such entity exists (or has been soft-deleted). The shared
IArchiveRuntimeStore.GetAsync(OctoObjectId) on the base store also returns a snapshot for
this entity (Mongo polymorphism); this method exists for callers that explicitly want the
time-range view and want to fail fast if the archive is a different subtype.
Task<ArchiveSnapshot> GetAsync(OctoObjectId archiveRtId)
Parameters
archiveRtId OctoObjectId
Returns
InsertAsync(String, RtCkId<CkTypeId>, IReadOnlyList<CkArchiveColumnSpec>, Nullable<TimeSpan>)
Creates a new TimeRangeArchive entity in CkArchiveStatus.Created. The
archive is not yet provisioned on CrateDB; the standard
IArchiveLifecycleService.ActivateAsync(OctoObjectId) path drives the DDL emission. Returns
the generated runtime id. Time-range concept §3, §10.
Task<OctoObjectId> InsertAsync(string rtWellKnownName, RtCkId<CkTypeId> targetCkTypeId, IReadOnlyList<CkArchiveColumnSpec> columns, Nullable<TimeSpan> period)
Parameters
rtWellKnownName String
Optional human-readable name; null falls back to the rtId.
targetCkTypeId RtCkId<CkTypeId>
CK type whose rows this archive captures windowed values for.
columns IReadOnlyList<CkArchiveColumnSpec>
User-picked attribute paths that become CrateDB storage columns.
period Nullable<TimeSpan>
Advisory period for the archive's windows (e.g. 15 min, 1 h). Optional and descriptive only —
the engine does not enforce that incoming windows match the declared period.
Returns
ArchiveEntityAsync(OctoObjectId)
Soft-deletes the time-range archive entity by setting rtState = Archived. The Crate
table is dropped separately by the lifecycle service via
IStreamDataRepository.DeleteArchiveAsync(OctoObjectId).
Task ArchiveEntityAsync(OctoObjectId archiveRtId)
Parameters
archiveRtId OctoObjectId