nx_checkpoint.nx
buildroot/runtime/nx_checkpoint.nx
about
nx_checkpoint.nx -- atomic high-water-mark file for resumable jobs.
Persists a single "last completed id" via .tmp + renameat.
genealogy_id: chandy_lamport_1985_snapshots + spark_checkpointing
lineage_id: resumable_state
dependencies 4 imports · 3 importers
imports: nx_syscalls.nxnx_tier.nxnx_str.nxnx_strconv.nx
imported by: nx_checkpoint_test.nxnx_ingest_runner.nxnx_ingest_runner_test.nx
structs
| 30 | struct NxCheckpoint |
consts
| 19 | const NX_CHECKPOINT_FRESH: nx_int = -1 |
| 20 | const NX_CHECKPOINT_WRITE_FAIL: nx_int = -2 |
| 21 | const NX_CHECKPOINT_RENAME_FAIL: nx_int = -3 |
| 28 | const SYS_RENAMEAT_LOCAL: nx_int = 276 // renameat2 (RV64) |
| 38 | const NX_CHECKPOINT_STRUCT_BYTES: nx_size = 48 |
| 39 | const NX_CHECKPOINT_PATH_CAP: nx_size = 512 |
functions
| 41 | func nx_ckpt_make_tmp(orig: *u8, out: *u8) -> nx_size |
| 54 | func nx_ckpt_parse_i64(buf: *u8, n: nx_int) -> nx_int called by 1: nx_checkpoint_open |
| 74 | func nx_checkpoint_open(path: *u8) -> *NxCheckpoint |
| 100 | func nx_checkpoint_close(cp: *NxCheckpoint) -> nx_int |
| 105 | func nx_checkpoint_get(cp: *NxCheckpoint) -> nx_int |
| 109 | func nx_checkpoint_set(cp: *NxCheckpoint, id: nx_int) -> nx_int called by 3: mainnx_ingest_run_offernx_ingest_run_close calls 4: sys_mmapnx_strconv_format_i64sys_writesys_close |
| 144 | func nx_checkpoint_n_writes(cp: *NxCheckpoint) -> nx_int { return cp.n_writes } called by 1: main |
| 145 | func nx_checkpoint_n_write_fail(cp: *NxCheckpoint) -> nx_int { return cp.n_write_fail } called by 1: main |
| 146 | func nx_checkpoint_is_fresh(cp: *NxCheckpoint) -> nx_int called by 1: main |