open

fun open(directory: Path, options: StoreOptions = StoreOptions.DEFAULT): DocumentStore

Opens the store in directory, replaying its manifest and its logs.

Recovery reads CURRENT for the manifest in force, folds its edits into the set of live segments, and then replays only the logs the manifest says are still needed. Each log is checked as it goes to begin where the previous one ended; the newest may have an interrupted tail — it is the one a dying process can have been in the middle of — and is truncated back to its last complete record before it is appended to again. Any other fault is reported; see LogRecoveryMode.

Throws

if another process, or another store in this one, holds it.

if a log cannot be replayed.

if the manifest cannot be replayed.

if a segment the manifest names cannot be read.

if the files are from a newer format version.

if the directory is absent and StoreOptions.createIfMissing is false.