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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! Observer trait for log write events.
//!
//! (`serialLogWork`). `UtilizationTracker` is fetched from `envImpl`
//! and called under the Log Write Latch (LWL) each time an entry is written.
//!
//! Defining the trait here in `noxu-log` avoids a circular dependency:
//! `noxu-cleaner` depends on `noxu-log`, so the trait must live in `noxu-log`
//! while the implementation lives in `noxu-cleaner`.
/// Which obsolete-counting variant the log write path should apply.
///
/// Mirrors JE's three `UtilizationTracker` obsolete methods. Defined here in
/// `noxu-log` (rather than `noxu-cleaner`) so the trait signature does not
/// create a circular dependency; `noxu-cleaner` maps it onto its own
/// `ObsoleteKind`.
/// An obsolete LSN to be counted on the log write path, with the metadata
/// JE's `UtilizationTracker` needs: the owning DB, the entry size, and which
/// counting variant to apply.
///
/// Bundled into one struct so adding the per-DB axis (CLN-9) and the
/// three-method distinction (CLN-10) does not require threading three extra
/// parameters through every `log()` overload.
/// Callback interface for utilization tracking on every log write.
///
/// `UtilizationTracker.countNewLogEntry` /
/// `countObsoleteNode` / `countObsoleteNodeInexact` calls made from
/// `LogManager.serialLogWork()`.
///
/// Implementations MUST be `Send + Sync` and MUST handle their own internal
/// locking because these methods are called **under the LWL**.