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
//! Application construction, pre-allocation, and operator policy.
//!
//! The server runtime constructs application instances in several
//! contexts: a fresh primary at startup, a replica preparing to
//! receive a snapshot transfer, a replica catching up from genesis
//! via journal replay, and the shadow stage (which maintains a
//! parallel copy for snapshotting). All share
//! [`AppFactory::empty`](crate::app_factory::AppFactory::empty). The
//! primary startup path additionally calls
//! [`AppFactory::prefault`](crate::app_factory::AppFactory::prefault) to
//! pre-size collections before the bulk-seed phase, then
//! [`AppFactory::apply_operator_policy`](crate::app_factory::AppFactory::apply_operator_policy)
//! for non-journaled config.
//!
//! Operator-controlled policy (rate limits, caps, ...) is kept
//! separate from journaled state.
//! [`AppFactory::apply_operator_policy`](crate::app_factory::AppFactory::apply_operator_policy)
//! reapplies these knobs after snapshot restore so primary and
//! replica converge on matching values even though the journal
//! carries no record of them.
use crateApplication;
/// Build and configure application instances on behalf of the
/// runtime.
///
/// Implementors are typically construction-config holders (sizing
/// hints, operator knobs) rather than zero-sized — they capture the
/// CLI-level values needed to produce `A` instances. Stored as
/// `Arc<dyn AppFactory<App = ConcreteA>>` on the runtime config so
/// replication paths can construct fresh apps after their snapshot
/// transfers or catch-up scans.