Readable Json Store
The read operations of a store, shared by the JsonStore that writes it and the SecondaryJsonStores that read it beside its writer: code that only reads takes a ReadableJsonStore and serves both.
The suspending operations run on a dispatcher with StoreOptions.ioParallelism threads; blocking offers the same operations without coroutines. Thread-safe. After close, operations throw StoreClosedException.
search and select aren't suspending: their results are resources read on the caller's thread, and starting one already reads — select locates its node, and a JSONPath search with a range reads the range's postings. Call them, and read their results, on a dispatcher that allows blocking work, such as Dispatchers.IO.
Every operation reads one consistent state of the store (SPEC.md §8), and a result keeps reading the state it started on until it is closed, whatever is written meanwhile.
Inheritors
Properties
What this store was created with; fixed for its life (see CreationOptions).
Functions
The same store without coroutines: a view that shares this store's state, valid until this store is closed. The view has no close of its own; closing this store is what releases it.
How many documents the key-order search returns for query, counting no further than atMost; see the other count.
How many hits the JSONPath search returns for query, counting no further than atMost; see the other count.
How many hits search returns for query on the current state, counting no further than atMost (SPEC.md §4.7): the same candidates and matches, with the query's after, type, mode and nested-hit filter, but no hit's JSON is read, and limit and maxBytes don't apply. count(query, n) == n tells whether there are at least n hits, and stops at the n-th. Refuses what search refuses; a negative atMost throws IllegalArgumentException.
The exact number of objects of type; reads the entry of every one of them.
The differences between a (left) and b (right), streamed in canonical order (SPEC.md §9.3): depth first, object members by key, array elements by index. Each collection runs the comparison on one new snapshot, on the store's dispatcher, and stops after DiffOptions.maxDifferences. Errors as in isEqual, thrown when collecting.
The visible document whose key is key in a store with a CreationOptions.documentKey, or null when none is (SPEC.md §3.3); with Normalization.NFC, key is normalized first. A store without document keys throws IllegalStateException.
Up to limit objects of type in (docId, nodePre) order from the current state, strictly after after when it's given; resume with the last one returned. Throws InvalidTypeNameException for an invalid name.
Every object of type in (docId, nodePre) order, strictly after after when it's given, as a flow. Each collection reads one new snapshot on the store's dispatcher and holds it until the collection ends, so what one collection emits is consistent: the objects of the type as the operations acknowledged before it started left them. Throws InvalidTypeNameException for an invalid name, when collecting.
Up to limit objects of type in (docId, nodePre) order from the current state, strictly after after when it's given, and where the next page starts: TypePage.cursor, null when no objects were left. Only the cursor of a TypePage resumes it, anything else throws InvalidCursorException.
Starts a search of documents in key order (SPEC.md §3.3) on the current state; close the result when done. A store without document keys throws IllegalStateException.
Starts a JSONPath search on the current state (SPEC.md §10.4): the distinct nodes the query selects from every document, in the query's order of (docId, nodePre). Close the result when done.
Starts a search on the current state, reading on the caller's thread; close the result when done. A search the index controls of CreationOptions leave unanswerable throws QueryRejectedException with QueryRejectedException.Reason.NOT_INDEXED (SPEC.md §4.6).
Reads everything the store can read back and reports what doesn't check out (SPEC.md §8): record and block checksums, the fragments each COMMIT still in the log names, and every fragment-index entry against the record it locates. Nothing is changed or repaired.