lightspeed/pipeline/checkpoint
Checkpoint and watermark contracts for deterministic pipeline replay.
Types
Persisted checkpoint entry for one stage transition.
pub type Checkpoint {
Checkpoint(
run_id: String,
stage: String,
sequence: Int,
watermark: Watermark,
idempotency_key: String,
at_ms: Int,
)
}
Constructors
-
Checkpoint( run_id: String, stage: String, sequence: Int, watermark: Watermark, idempotency_key: String, at_ms: Int, )
Replay-safe stage watermark.
pub type Watermark {
Watermark(offset: Int, event_time_ms: Int)
}
Constructors
-
Watermark(offset: Int, event_time_ms: Int)
Values
pub fn chain_signature(entries: List(Checkpoint)) -> String
Stable checkpoint chain signature.
pub fn checkpoint(
run_id: String,
stage: String,
sequence: Int,
watermark: Watermark,
idempotency_key: String,
at_ms: Int,
) -> Checkpoint
Build one checkpoint.
pub fn latest(
entries: List(Checkpoint),
) -> option.Option(Checkpoint)
Latest checkpoint in chronological order.
pub fn latest_for_stage(
entries: List(Checkpoint),
stage: String,
) -> option.Option(Checkpoint)
Latest checkpoint for one stage.
pub fn resume_point_for_stage(
entries: List(Checkpoint),
stage: String,
) -> Result(ResumePoint, String)
Derive one resume point for a stage.
pub fn resume_point_label(point: ResumePoint) -> String
Stable resume-point label.