|
Everett
|
We can write sorted records directly to a private .kv attempt, merge mapped inputs into another attempt, and publish the completed result through SQLite. The payload need not accumulate in an in-memory array. The writer keeps a 64 KiB payload buffer, bounded control scratch and one residual offset per physical block; finishing builds the Elias–Fano directory from those offsets. The checked record writer also retains its previous key. The default merge retains its two input keys as references into the pinned source files.
This complete program takes an existing empty object directory as its only argument. The caller establishes that directory and its ancestors durably. The example allocates deterministic identities because it creates a fresh catalog; an application supplies its own fresh identity allocator.
Link with everett::sqlite as described in the catalog guide. The example uses trusted admission because the checked writers establish the sorted-key encoding and the terminal indexes contain no borrowed samples. Received or uncertain objects can require explicit scans instead.
The tables here have at most \(K\) records, so a terminal pair is already a prepared query root. A larger head needs an empty-native routing prefix built from its augmented samples before publication. The file-index pipeline builds those links without rewriting the existing native files or accumulating their borrowed payloads in memory.
step limits distinct keys, not bytes or elapsed time. Large literals, values, composition callbacks and final metadata construction have their own costs. The underlying output streams complete bytes and CRC state as construction proceeds, then backpatch the private directory at finalization without a body readback. Both public file wrappers are nonmovable; their input mappings stay pinned while a merge pauses or fails.
Only a successful finish seals an object. An interrupted private output is retained for reconciliation, but the merge does not yet restore its construction state after a process restart. The continuation contract separates that work from the already durable publication of completed files.