Registers a listener told after any mutation.
The listener.
A function that removes it.
Every record, for the callers that render the log rather than search it.
This is the whole log — every query, not one per question — because
that is what /net/pacs/queries lists and what an operator went
looking for when they could not find a query they knew they had run.
Forgets one query, for when its stored answer turns out to be gone.
The criteria it was filed under.
The PACS it was asked of.
The identity that asked.
Looks a question up.
The criteria being asked.
The PACS being asked.
The identity asking; another identity's answer is not an answer to this question.
What is known, or null when this question is new to the index.
Files a query under its question.
The newest answer to a question wins: asking the same thing twice leaves the later record indexed, which is the one whose age a replay should state.
What was asked, of whom, and what came back.
The oldest record the back-fill has walked, where it resumes.
An ISO timestamp, or null before the first sweep.
Records how far back the sweep has reached.
The oldest record walked, as an ISO timestamp.
Whether the index already holds a record for a query id.
A resumed sweep asks this to count what it newly filed apart from the boundary record its inclusive resume re-fetches.
The query's numeric id.
True when the id is already indexed.
The newest record held, which is where a resumed sweep starts.
A completed sweep has walked everything down to the floor, so the only thing a later boot can be missing is what arrived since. Asking CUBE for records at or after this turns a rebuild into a top-up.
An ISO timestamp, or null when the index is empty.
How many distinct questions those records answer.
Empties the index. For tests, and for a change of identity.
How many records the index holds.
Merges a snapshot in, keeping anything this process already learned: a query indexed since the checkpoint was written is newer than the checkpoint by definition.
A validated snapshot.
What has already been asked of which PACS, and where the answer is kept.