lightspeed/pipeline
Integrated data-pipeline core contracts for M31.
Types
Stage boundary contracts.
pub type Boundary {
Boundary(input_contract: String, output_contract: String)
}
Constructors
-
Boundary(input_contract: String, output_contract: String)
Pipeline lifecycle.
pub type Lifecycle {
Idle
Scheduled(at_ms: Int)
Triggered(reason: String, at_ms: Int)
Running(run_id: String, started_ms: Int)
Failed(run_id: String, reason: String)
Crashed(run_id: String, reason: String)
Replaying(run_id: String, from_stage: String, started_ms: Int)
Completed(run_id: String, finished_ms: Int)
}
Constructors
-
Idle -
Scheduled(at_ms: Int) -
Triggered(reason: String, at_ms: Int) -
Running(run_id: String, started_ms: Int) -
Failed(run_id: String, reason: String) -
Crashed(run_id: String, reason: String) -
Replaying(run_id: String, from_stage: String, started_ms: Int) -
Completed(run_id: String, finished_ms: Int)
Stage processing result.
pub type ProcessResult {
Applied(checkpoint: checkpoint.Checkpoint)
DuplicateSuppressed(stage: String, idempotency_key: String)
Rejected(reason: String)
}
Constructors
-
Applied(checkpoint: checkpoint.Checkpoint) -
DuplicateSuppressed(stage: String, idempotency_key: String) -
Rejected(reason: String)
Runtime
opaquePipeline runtime.
pub opaque type Runtime
Pipeline schedule profile.
pub type Schedule {
Manual
Interval(interval_ms: Int)
Cron(expression: String)
}
Constructors
-
Manual -
Interval(interval_ms: Int) -
Cron(expression: String)
Stage category.
pub type StageKind {
Source
Transform
Sink
}
Constructors
-
Source -
Transform -
Sink
Values
pub fn checkpoints(
runtime: Runtime,
) -> List(checkpoint.Checkpoint)
Stable checkpoints in emit order.
pub fn pipeline(
name: String,
schedule: Schedule,
stages: List(Stage),
) -> Pipeline
Build one pipeline contract.
pub fn pipeline_signature(pipeline: Pipeline) -> String
Stable pipeline signature.
pub fn process(
runtime: Runtime,
stage_name: String,
processed_records: Int,
lag_ms: Int,
idempotency_key: String,
now_ms: Int,
) -> #(Runtime, ProcessResult)
Process one stage event.
pub fn process_result_label(result: ProcessResult) -> String
Stable process-result label.
pub fn record_dead_letter(
runtime: Runtime,
count: Int,
) -> Runtime
Record dead-letter increments for the active run.
pub fn resume_from_latest_checkpoint(
runtime: Runtime,
now_ms: Int,
) -> Result(Runtime, String)
Resume from the latest checkpoint.
pub fn runtime_telemetry(runtime: Runtime) -> telemetry.Snapshot
Runtime telemetry accessor.
pub fn sink_idempotency_keys(runtime: Runtime) -> List(String)
Sink idempotency keys in application order.
pub fn source_stage(
name: String,
output_contract: String,
) -> Stage
Build a source stage.
pub fn transform_stage(
name: String,
input_contract: String,
output_contract: String,
) -> Stage
Build a transform stage.