code wiki / (root) / nx_seg_compact_cli.nx

nx_seg_compact_cli.nx

buildroot/runtime/nx_seg_compact_cli.nx

4534 B74 linesdepth 8pulls 15 transitivereach 0 importersview sourcekind tooltopic seg
docsdependenciesstructsconstsfunctions

about

nx_seg_compact_cli.nx -- run seg-store COMPACTION for one shard prefix. Folds all live segments into ONE merged segment (latest entry per key; tombstones kept), archives the retired segment names (additive -- never deletes), atomically swaps the live manifest. This is the PERF fix for the data-driven-search debt: after fixing the 256-segment read cap, search loads ALL live segments per query -- compaction folds a large uncompacted shard (e.g. 936 segs) into ~1 so per-query load stays cheap. Uses the FIXED (data-driven, no 256/260 cap) ss_compact. Runs in nishihost CWD (the dp-<domain>-pub- store resolves there). usage: nx_seg_compact_cli <store-prefix> <new-segid> e.g. nx_seg_compact_cli knowledge/store/dp-nishifamily.com-pub- 9000000000000000001 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_seg_store.nx nx_heavyio_lib.nx nx_seg_compact_cli.nx

imports: nx_syscalls.nxnx_seg_store.nxnx_heavyio_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main scc_puts sys_write scc_atoi sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ hio_admit sys_mmap ↻ hio_root sys_mmap ↻ hio_cat sys_openat_rd sys_close hio_cat ↻ hio_admit_conf_root sys_mmap ↻ hio_conf_read sys_openat_rd ↻ sys_mmap ↻ sys_read sys_close ↻ hio_eol hio_keyis hio_slot hio_atoi hio_running ioa_count_comm

structs

none

consts

none

functions

14func scc_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
15func scc_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
24func scc_atoi(s: *u8) -> i64
called by 1: main
30func main(argc: i64, argv: *i64) -> i64