Expand description
Bulk RDF import: online (RPC) or offline (in-process RocksDB).
- default: spawn S/P/O + registry, stream chunks over gRPC, flush, optional compact
--connect: attach to a running cluster; do not spawn or kill children--offline: in-process hexastore WriteBatch load with deferred registry SST runs (RegistryStaging); always flush + compact. The load open attaches the stats collectors, so the flush writeswaratah.stats(including the temporal histogram on O). The end compact merges L0 and skips the bottommost rewrite. A chunk’s run is renamed into place only when its SST write and hexastore apply both succeed. A write error ingests the renamed runs and skips compaction; a killed import is recovered the next time the registry opens. An import into an empty O store stamps the geo and temporal index epochs to the importcommit_ts.
A parser thread fills a sync_channel(1) of waratah_compute::INSERT_QUAD_CHUNK
quads so the next parse overlaps the current write.
Online imports with the text plugin enabled establish trust BEFORE any batch: an untrusted index is pre-built against the running cluster (covering the store’s pre-existing rows), a fingerprint mismatch refuses, and the bracket’s finish stamps only when it began against a trusted index — an import’s documents cover only the imported rows, so stamping over an untrusted begin would declare trust over the pre-existing rows the index never saw.
Macros§
- status 🔒
- Print an importer status line prefixed with the current UTC timestamp.
Structs§
- Import
Options - Options for
run. - Index
Epoch 🔒Plan - Which index epochs a successful offline import may stamp.
- Load
Stats 🔒 - Offline
Stores 🔒 - Registry
Staging 🔒 - Staged registry SST run files awaiting bulk ingest at the end of an offline import.
- Text
Import 🔒Bracket - One online import’s text-index bracket: the rebuild lease token plus the trust snapshot the stamp gate needs.
Constants§
- PROGRESS_
INTERVAL 🔒 - How often to print insert progress during a long import.
Functions§
- abort_
offline_ 🔒import - Flush finished chunks and ingest their renamed registry runs, then return
write_err. Hexastore compaction and the epoch stamp are skipped: this import did not finish. - bracket_
online_ 🔒text_ import - Take the online import’s text rebuild lease (
waratah_text’s import config; fingerprint-checked against any existing index by the partition’s begin) soPutTextIndexframes have somewhere to land. - civil_
from_ 🔒unix_ days - Gregorian date for
dayssince 1970-01-01 (Howard Hinnantcivil_from_days). - close_
online_ 🔒text_ import - Release the bracket (
bracket_online_text_import). Stamps the epoch only when the load succeeded AND the index read trusted at begin: a begin against an untrusted index plus this load’s documents is exactly a partial index, and stamping it would declare trust over the pre-existing rows the index never saw (the trusted-but-incomplete state). Untrusted → release without stamping; the next startup build owns the epoch. A FAILED import always releases without stamping — the index must not read trusted over an import that did not complete. - compact_
offline_ 🔒hexastore - compact_
online 🔒 - Compact S/P/O and the registry. The RPC returns when compaction has finished.
- dedupe_
registry_ 🔒entries - describe_
is_ 🔒trusted - The trust rule the shells use: a stamped epoch AND the O partition’s fingerprint matching this config, strictly.
- describe_
text 🔒 - Online import text bracket: create/open the O partition’s index with the The O partition’s Describe — where the text-index trust covariates live.
- ensure_
trusted_ 🔒text_ index - Ensure the running cluster’s text index reads TRUSTED before an online import loads any data.
- index_
epochs_ 🔒to_ stamp - Decide whether this import may stamp the geo and temporal epochs.
- join_
axis 🔒 - join_
compact 🔒 - Join a scoped compaction/ingest thread; a panic becomes
DevError::OfflineWritePanic. - lease_
wait_ 🔒until_ trusted - Bounded wait for a concurrent rebuild’s lease to end and its stamp to
land: poll the O Describe every 5 s for up to 60 s.
Some(())when the index reads trusted;Nonewhen the wait ran out. - load_
offline 🔒 - load_
online 🔒 - maybe_
report_ 🔒progress - now_
commit_ ts - Unix milliseconds, or
1if the clock is before the epoch. - now_
stamp 🔒 - UTC
YYYY-MM-DDTHH:MM:SS.mmmZfor status lines. - open_
hexastore 🔒 - report_
spike_ 🔒reductions - run
- Spawn, connect, or load offline depending on
ImportOptions. - run_
connect 🔒 - run_
offline 🔒 - run_
spawn 🔒 - screen_
offline_ 🔒text_ docs - Fail-closed lexical screen for the offline import’s text documents
(offline twin of the write-path guard in
WriteFanout::insert_quads_rpc): the text plugin indexes every string literal, and the rebuild walk skips lexicals above the limit and refuses to stamp — an oversized document landing here would create a trusted index state the repair command can never reproduce. The whole import fails loudly instead. The offline route has no gRPC wire and no registry length check, so this screen is the only guard on it. - stamp_
offline_ 🔒index_ epochs - Stamp the epochs selected by
index_epochs_to_stamptocommit_ts. - write_
offline_ 🔒chunk