pub struct BatchSpec {
pub run_id: RunId,
pub gateway: String,
pub mode: String,
pub writes: Vec<WriteOp>,
pub deletes: Vec<DeleteOp>,
pub ledger_new: Option<Vec<u8>>,
pub ledger_pre: Option<String>,
pub journal: Journal,
pub record: RunRecord,
pub commit_budget_s: Option<u32>,
}Expand description
Everything one prepare and commit need, decided by the engine.
writes and deletes are byte-sorted and unique and disjoint. The
journal and record are the run’s documents as the engine wants them; the
host sets the journal phase itself at each step.
Fields§
§run_id: RunIdThe run.
gateway: StringThe target gateway directory name.
mode: StringThe target mode collection.
writes: Vec<WriteOp>The files to write.
deletes: Vec<DeleteOp>The files to delete.
ledger_new: Option<Vec<u8>>The new ledger bytes (already validated with Ledger::parse), swapped
last. None leaves the ledger alone.
ledger_pre: Option<String>The live ledger hash the plan was made against; None when there is no
ledger yet.
journal: JournalThe journal of this run.
record: RunRecordThe run record at state applying.
commit_budget_s: Option<u32>The seconds, from the start of the commit, within which the moves and
deletes must be done: the scan-lock hold less its margin. A host stops
before the next move, delete or retry once it is spent and reports
BatchReport::deadline. None sets no limit.
Implementations§
Source§impl BatchSpec
impl BatchSpec
Sourcepub fn touched_paths(&self) -> Vec<String>
pub fn touched_paths(&self) -> Vec<String>
The paths this run touches, byte-sorted: every write, every delete and
LEDGER_KEY when the ledger is swapped.
Sourcepub fn problem(&self) -> Option<String>
pub fn problem(&self) -> Option<String>
The first thing wrong with this spec, or None. A host calls this
before any I/O; the engine builds a valid spec, so a problem here is a
defect, reported value-free.
Sourcepub fn journal_at(&self, phase: JournalPhase) -> Journal
pub fn journal_at(&self, phase: JournalPhase) -> Journal
The journal of this run at phase.