attach

fun attach(store: DocumentStore, backfill: Boolean = true)

Loads what is on disk, scans whatever is not, and starts maintaining the model.

Idempotent and cheap to repeat: a segment already covered is skipped without being read. Segments that have no sidecar are read once, in key order, exactly as a compaction would read them — see DocumentStore.backfill.

Parameters

backfill

whether to build sketches for segments that have none. Passing false attaches to whatever is already on disk and returns without a scan — CatalogCoverage then reports the model as partial, which is the honest state rather than a degraded one. Two callers want it: one with a large store who will not pay a blocking scan at open, and rabosh-api, which attaches this catalog and the index catalog without backfilling and then runs one DocumentStore.backfill through a composite observer instead of one scan each.

Throws