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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! A single-container Apache Pinot "QuickStart" cluster: controller, broker, server,
//! minion, and an embedded ZooKeeper, all as one process tree inside one image,
//! started with `QuickStart -type EMPTY` (a clean cluster with no demo tables — this
//! module is a real-cluster smoke fixture, not a data-loading harness).
//!
//! ### Ports — empirically verified, not the QuickStart docs' assumption
//!
//! The controller REST API is on 9000 as documented. The broker's **query** port is
//! **8000**, not 8099 — confirmed from a real `QuickStart -type EMPTY` boot log:
//!
//! ```text
//! StartControllerCommand ... -controllerPort 9000 ...
//! INFO: Started listener bound to [0.0.0.0:9000]
//! StartBrokerCommand ... -brokerPort 8000 -brokerGrpcPort 8010 ...
//! INFO: Started listener bound to [0.0.0.0:8000]
//! ```
//!
//! `curl http://<host>:8000/health` returns `503` while the broker is still
//! registering with the cluster and `200` once it's live; 8099 is not opened by
//! QuickStart at all. This module exposes 8000 and names the helper `broker_url`
//! accordingly.
//!
//! ### Memory — measured, not the originally-planned 2048 MB
//!
//! QuickStart runs a ZooKeeper + controller + broker + server + minion JVM in one
//! container, and the image itself bakes in `JAVA_OPTS=-Xms4G -Xmx4G` (confirmed via
//! `docker inspect`) — the QuickStartRunner driver JVM alone wants a 4 GiB heap before
//! the four sub-JVMs it spawns take anything. `with_memory_limit(2048)` (the
//! SpringCloudConfig/Paketo analogy, scaled up for four JVMs instead of one) badly
//! under-shot. Measured directly against a real `apachepinot/pinot:1.5.1
//! QuickStart -type EMPTY` boot:
//!
//! ```text
//! --memory=2048m -> OOMKilled=true (timed out at 180s waiting for /health, reaped by the kernel)
//! --memory=2560m -> OOMKilled=true
//! --memory=3072m -> OOMKilled=false; /health 200 within ~15s; BUT settles at ~99% of the 3 GiB
//! limit, and under that pressure the controller's Helix-backed schema/table
//! RPCs intermittently time out (a schema POST returns
//! {"code":500,"error":"java.util.concurrent.TimeoutException"}) even though
//! /health reports 200. Reproduced repeatedly at 3072m.
//! --memory=4096m -> stable: settles at ~73-75% of the limit, comfortable headroom; schema POST
//! succeeded on every attempt across a 60s repeated-POST probe.
//! ```
//!
//! So [`Container::with_memory_limit`] is **4096 MB** — the lowest round number with
//! real headroom above the image's own 4 GiB heap request, not merely enough to dodge
//! the OOM killer. Verified stable on both Docker and microsandbox.
use Duration;
use ;
const CONTROLLER_PORT: u16 = 9000;
const BROKER_PORT: u16 = 8000;
/// A single-container Apache Pinot QuickStart cluster.
;
/// The running guard for a [`PinotContainer`].
;