Reads a checkpoint by ID, or the latest valid checkpoint if ID is not specified. Verifies checksums before returning data.
Arguments
- result_path
Character string giving the base path for results. If NULL, the function returns NULL immediately.
- checkpoint_id
Integer specifying the checkpoint ID to read. If NULL (default), reads the latest checkpoint from latest.json.
- load_outcomes
Logical; when FALSE, validate shard integrity but omit materializing accumulated outcomes. Used by the filesystem RunStore while appending the next ledger checkpoint.
Value
A list with the following elements, or NULL if checkpoint not found or invalid:
checkpoint_id- Integer ID of the checkpointmeta- List of checkpoint metadatatask_grid- Tibble/data.frame of task grid with statusresults_df- Data frame of task results
Details
The function performs the following steps:
If checkpoint_id is NULL, read latest.json to get the latest ID
Construct checkpoint directory path from the ID
Verify directory exists
Verify checksums match
Read meta.json, ledger.rds, and results.rds
Return assembled checkpoint data
If the checkpoint has invalid checksums, a warning is issued and NULL is returned. This allows the caller to fall back to earlier checkpoints.