Commit 729538e
authored
feat: Add the FDv2 data system configuration API (#193)
## Summary
Adds the public API for configuring an FDv2 data system and selecting it
over the FDv1 data source.
- `ConfigBuilder::data_system` takes a `DataSystemBuilder` and, when
set, supersedes the FDv1 `data_source`. It is ignored in offline or
daemon mode.
- `DataSystemBuilder::default()` provides the recommended setup, while
`custom()` lets the caller assemble the sources and FDv1 fallback
explicitly and tune the fallback and recovery timeouts.
- `FDv2StreamingBuilder` and `FDv2PollingBuilder` configure individual
sources, each with a `base_url` override.
The builders are public, while the factory and per-source configuration
traits behind them stay internal.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Overview**
> Adds an optional **FDv2 data system** path on
`ConfigBuilder::data_system`, wired through `Client` startup so a
configured `DataSystemBuilder` **replaces** the legacy FDv1
`data_source` (with warnings and a null data source when both are set).
Offline and daemon mode still drop custom data-system config like they
do for custom data sources.
>
> Introduces **`data_system_builders`** with `DataSystemBuilder`
(`custom()` vs `default()` recommended stack: poll initializer, stream +
poll synchronizers, FDv1 polling fallback), plus `FDv2StreamingBuilder`
and `FDv2PollingBuilder` for URL/transport/reconnect tuning. Factory
wiring builds `FDv2DataSystem`, optionally wrapping an FDv1 fallback via
`FDv1AdapterFactory`.
>
> Exposes an experimental **`data_sources`** module and widens
visibility on FDv2 traits/types (`Initializer`/`Synchronizer`,
`ChangeSet`, errors, headers) so custom sources can be implemented; adds
polling/streaming **factory** types to instantiate sources per
orchestrator run.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
14c20fc. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 6996466 commit 729538e
14 files changed
Lines changed: 767 additions & 40 deletions
File tree
- launchdarkly-server-sdk/src
- fdv2
- stores
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
184 | 191 | | |
185 | 192 | | |
186 | 193 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
194 | 212 | | |
195 | 213 | | |
196 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
167 | 174 | | |
168 | 175 | | |
169 | 176 | | |
| |||
212 | 219 | | |
213 | 220 | | |
214 | 221 | | |
| 222 | + | |
215 | 223 | | |
216 | 224 | | |
217 | 225 | | |
| |||
226 | 234 | | |
227 | 235 | | |
228 | 236 | | |
| 237 | + | |
229 | 238 | | |
230 | 239 | | |
231 | 240 | | |
| |||
258 | 267 | | |
259 | 268 | | |
260 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
261 | 280 | | |
262 | 281 | | |
263 | 282 | | |
| |||
307 | 326 | | |
308 | 327 | | |
309 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
310 | 343 | | |
311 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
312 | 350 | | |
313 | 351 | | |
314 | 352 | | |
| |||
401 | 439 | | |
402 | 440 | | |
403 | 441 | | |
| 442 | + | |
404 | 443 | | |
405 | 444 | | |
406 | 445 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments