Zum Hauptinhalt springen

RollupSourceReference

Namespace: Meshmakers.Octo.Runtime.Contracts.StreamData

One source archive of a RollupArchiveSnapshot together with the half-open validity span in which it is authoritative (AB#5157, System.StreamData 1.8.0).

public record RollupSourceReference : IEquatable<RollupSourceReference>

Inheritance Object → RollupSourceReference
Implements IEquatable<RollupSourceReference>

Remarks:

RollupSourceReference.ValidFrom is inclusive and RollupSourceReference.ValidTo is exclusive, so two references that abut at the same timestamp are disjoint: the typical cutover setup is one legacy source with ValidTo = cutover and one native source with ValidFrom = cutover, and the cutover bucket belongs to the native source. An unset bound means "open" in that direction.

The validator enforces that spans are pairwise disjoint, that at most one reference has an open start and at most one an open end, and that every boundary lies on a bucket boundary of the rollup in its reference time zone — so a bucket is always contained in exactly one span or in none. See concept-multi-source-rollups.md.

Properties​

SourceArchiveRtId​

Runtime id of the source archive (raw, time-range, or another rollup for a chained ladder). Each archive may appear at most once in a rollup's source list.

public OctoObjectId SourceArchiveRtId { get; set; }

Property Value​

OctoObjectId

ValidFrom​

Inclusive start of the span; null ⇒ open start (the source covers every bucket before RollupSourceReference.ValidTo).

public Nullable<DateTime> ValidFrom { get; set; }

Property Value​

Nullable<DateTime>

ValidTo​

Exclusive end of the span; null ⇒ open end (the source covers every bucket from RollupSourceReference.ValidFrom onwards).

public Nullable<DateTime> ValidTo { get; set; }

Property Value​

Nullable<DateTime>

IsUnbounded​

True when neither bound is set — the source is authoritative for every bucket. The storage form the deprecated single SourceArchiveRtId scalar normalises into.

public bool IsUnbounded { get; }

Property Value​

Boolean

Constructors​

RollupSourceReference(OctoObjectId, Nullable<DateTime>, Nullable<DateTime>)​

One source archive of a RollupArchiveSnapshot together with the half-open validity span in which it is authoritative (AB#5157, System.StreamData 1.8.0).

public RollupSourceReference(OctoObjectId SourceArchiveRtId, Nullable<DateTime> ValidFrom, Nullable<DateTime> ValidTo)

Parameters​

SourceArchiveRtId OctoObjectId
Runtime id of the source archive (raw, time-range, or another rollup for a chained ladder). Each archive may appear at most once in a rollup's source list.

ValidFrom Nullable<DateTime>
Inclusive start of the span; null ⇒ open start (the source covers every bucket before RollupSourceReference.ValidTo).

ValidTo Nullable<DateTime>
Exclusive end of the span; null ⇒ open end (the source covers every bucket from RollupSourceReference.ValidFrom onwards).

Remarks:

RollupSourceReference.ValidFrom is inclusive and RollupSourceReference.ValidTo is exclusive, so two references that abut at the same timestamp are disjoint: the typical cutover setup is one legacy source with ValidTo = cutover and one native source with ValidFrom = cutover, and the cutover bucket belongs to the native source. An unset bound means "open" in that direction.

The validator enforces that spans are pairwise disjoint, that at most one reference has an open start and at most one an open end, and that every boundary lies on a bucket boundary of the rollup in its reference time zone — so a bucket is always contained in exactly one span or in none. See concept-multi-source-rollups.md.

Methods​

Contains(DateTime, DateTime)​

True when the half-open bucket [, ) lies entirely inside this reference's span. A bucket that only partially overlaps the span is not covered — the aggregation of a bucket must never mix two sources.

public bool Contains(DateTime bucketStart, DateTime bucketEnd)

Parameters​

bucketStart DateTime
Inclusive start of the bucket.

bucketEnd DateTime
Exclusive end of the bucket.

Returns​

Boolean

Clip(DateTime, DateTime)​

Intersects the half-open range [, ) with this reference's span and returns the clipped range, or null when the intersection is empty. Used by the recompute orchestrator to restrict a dirty range to the span of the source that produced it — on both ends. An empty or inverted input range (from >= to) yields null as well: a caller holding a single-point change must widen it to a non-empty range first.

public Nullable<ValueTuple<DateTime, DateTime>> Clip(DateTime from, DateTime to)

Parameters​

from DateTime
Inclusive start of the range to clip.

to DateTime
Exclusive end of the range to clip; must be after from for a non-null result.

Returns​

Nullable<ValueTuple<DateTime, DateTime>>