Skip to main content

ArchiveSnapshot

Namespace: Meshmakers.Octo.Runtime.Contracts.StreamData

Read-only snapshot of the parts of a CkArchive entity the lifecycle service needs. Intentionally narrower than the full RtEntity: the lifecycle decisions only depend on ArchiveSnapshot.Status plus identification fields. Backend-specific stores translate from their concrete representation to this record. Columns carries the user-configured archive columns (path/indexed/required) the data-store provider needs to generate DDL — empty when the archive only has the standard time-series columns.

public record ArchiveSnapshot : IEquatable<ArchiveSnapshot>

Inheritance ObjectArchiveSnapshot
Implements IEquatable<ArchiveSnapshot>

Properties

RtId

public OctoObjectId RtId { get; set; }

Property Value

OctoObjectId

TargetCkTypeId

public RtCkId<CkTypeId> TargetCkTypeId { get; set; }

Property Value

RtCkId<CkTypeId>

Status

public CkArchiveStatus Status { get; set; }

Property Value

CkArchiveStatus

RtWellKnownName

public string RtWellKnownName { get; set; }

Property Value

String

Columns

public IReadOnlyList<CkArchiveColumnSpec> Columns { get; set; }

Property Value

IReadOnlyList<CkArchiveColumnSpec>

RollupAggregations

When this snapshot represents a RollupArchive, the aggregation specs from which ArchiveSnapshot.Columns were derived (via RollupColumnGenerator). Null for raw and time-range archives. The DDL path uses this to skip CK-type attribute resolution for rollups — the derived column names (e.g. temperature_avg_sum) are storage identifiers, not paths into the CK type, so the column SQL type is determined by the aggregation function instead. Concept §4.

public IReadOnlyList<CkRollupAggregationSpec> RollupAggregations { get; set; }

Property Value

IReadOnlyList<CkRollupAggregationSpec>

IsTimeRange

True when this snapshot represents a TimeRangeArchive — each row carries an explicit [window_start, window_end) instead of a single timestamp. The DDL path emits two timestamp columns + a was_updated flag column, and the natural key becomes (window_start, window_end, rtid, ckTypeId). Concept §4 + §6.

public bool IsTimeRange { get; set; }

Property Value

Boolean

Remarks:

Discriminator semantics: ArchiveSnapshot.RollupAggregations non-null ⇒ rollup; ArchiveSnapshot.IsTimeRange true ⇒ time-range; both false ⇒ raw archive. Rollups and time-range archives are mutually exclusive at the storage shape level (a rollup snapshot has IsTimeRange = false today; the rollup-on-time-range unification ships in Phase 7).

Period

Advisory period for a TimeRangeArchive's windows (e.g. 15 min, 1 h, 1 d). Optional and descriptive only — the engine does not enforce that incoming windows match the declared period. Null for raw and rollup archives.

public Nullable<TimeSpan> Period { get; set; }

Property Value

Nullable<TimeSpan>

UsesWindowedStorage

True when this snapshot's storage shape is the windowed (window_start, window_end, rtid, ckTypeId) + was_updated layout — i.e. either a rollup archive (Phase 7 unification) or a time-range archive. False ⇒ raw archive with the single timestamp column. Concept-time-range §4 / §6.

public bool UsesWindowedStorage { get; }

Property Value

Boolean

Constructors

ArchiveSnapshot(OctoObjectId, RtCkId<CkTypeId>, CkArchiveStatus, String, IReadOnlyList<CkArchiveColumnSpec>)

Read-only snapshot of the parts of a CkArchive entity the lifecycle service needs. Intentionally narrower than the full RtEntity: the lifecycle decisions only depend on ArchiveSnapshot.Status plus identification fields. Backend-specific stores translate from their concrete representation to this record. Columns carries the user-configured archive columns (path/indexed/required) the data-store provider needs to generate DDL — empty when the archive only has the standard time-series columns.

public ArchiveSnapshot(OctoObjectId RtId, RtCkId<CkTypeId> TargetCkTypeId, CkArchiveStatus Status, string RtWellKnownName, IReadOnlyList<CkArchiveColumnSpec> Columns)

Parameters

RtId OctoObjectId

TargetCkTypeId RtCkId<CkTypeId>

Status CkArchiveStatus

RtWellKnownName String

Columns IReadOnlyList<CkArchiveColumnSpec>