State
struct StateA connection to orca's database.
Implements Movable
- Fields
conn: Connection
__init__
def __init__(out self, url: String) migrate
def migrate(mut self) Creates the schema, or applies the migrations it hasn't had.
register
def register(mut self, pipeline: String, registry_hash: String, describe: String) Records a pipeline, or updates it to this binary's DAG.
scheduled_hash
def scheduled_hash(mut self, pipeline: String) -> String The registry hash orca register gave pipeline, or empty if it wasn't registered with a binary.
version
def version(mut self, pipeline: String, registry_hash: String, describe: String, image: String) -> Int The version of pipeline that code registry_hash, from the source describe (a pipeline binary's) names, in image is; recorded the first time it's seen.
ran_version
def ran_version(mut self, run: Int, version: Int) Records that run is running version's code.
create_run
def create_run(mut self, pipeline: String, registry_hash: String, partitions: String, trigger: String, owner: String) -> Int A new run, already claimed by owner.
run_info
def run_info(mut self, run: Int) -> RunInfo claim
def claim(mut self, run: Int, owner: String, stale_seconds: Float64) Makes owner the run's writer, if no live process holds it.
A run can be claimed while it's queued, unfinished (running with
a stale or cleared heartbeat; the scheduler starts a run with none)
or failed. Raises otherwise, saying why.
interrupt
def interrupt(mut self, run: Int, why: String = "") -> Int Marks attempts left running by a process that died as failed, and returns how many there were. why is their error and their steps', such as a crash's (orca.crash); empty, it's INTERRUPTED.
prior
def prior(mut self, run: Int) -> RunResult The run's succeeded steps, with their outputs, for resuming it.
finish_run
def finish_run(mut self, run: Int, owner: String, status: String) Ends the run and clears its heartbeat, so it can be resumed at once if it failed.
defer_run
def defer_run(mut self, run: Int, owner: String, until: Int64) Ends the run deferred, to be started again at until (on the scheduler's clock) by the scheduler, whatever started it; that start isn't counted against its retries.
cancel_requested
def cancel_requested(mut self, run: Int) -> Bool runs
def runs(mut self, limit: Int = Int(20), before: Int = Int(0), status: String = "") -> List[RunInfo] The latest runs, newest first; those under before if it isn't 0, and with status (one or several, comma-separated) one of those.
steps
def steps(mut self, run: Int) -> List[StepInfo] A run's steps in run order, with their attempt counts.