1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use HashMap;
use PathBuf;
use cratePointOffsetType;
use crateUniversalRead;
pub use LiveReloadResult;
use cratePointMappings;
use crate;
/// Implementation of read-only ID tracker which operates
/// on top of appendable data format.
///
/// Structure can't modify data itself, but can consume appends from external entity by
/// doing live-reload.
///
/// Backed by [`UniversalRead`] file handles so it works over any storage backend (mmap, io_uring,
/// object storage, ...). The handles are retained between reloads and refreshed via
/// [`UniversalRead::reopen`] to pick up data appended by the writer.
///
/// The mappings and versions files may be absent: the writer only creates them once it flushes the
/// first point (an empty file is never written), exactly as
/// [`MutableIdTracker::open`](crate::id_tracker::mutable_id_tracker::MutableIdTracker::open)
/// tolerates. A missing file is treated as an empty storage; the retained [`Self::fs`] lets the
/// handle be opened lazily once the file appears.
///
/// The mapping only ever contains *committed* points. The writer flushes mappings before data
/// before versions, so a point is fully written only once its version is present. An insert read
/// from the mappings log is therefore held in [`Self::pending_inserts`] until its version is
/// flushed, and only then linked into [`Self::mappings`].