Commit dba6f9b
use allocator to configure event tracker instead of admin
Summary:
Add eventTrackerConfigFactory to CacheAllocatorConfig — a factory function (std::function<EventTracker::Config()>) that creates a fresh
EventTracker::Config on demand.
EventTracker::Config contains unique_ptr members (EventSink, SamplerInterface) for dependency injection of abstract interfaces. This makes the config move-only, so it can only be consumed once. During warm roll recovery, CacheAllocatorConfig is reused to re-initialize the allocator, which means a directly-stored config would be invalid after the first use.
The factory pattern solves this by producing a new EventTracker::Config with fresh unique_ptr instances each time the allocator initializes. This moves event tracker setup from the admin server into the allocator config, keeping configuration self-contained.
Reviewed By: rlyerly
Differential Revision: D95624875
fbshipit-source-id: 2d78dfc522daa281e24aa32d727e21f5568c37721 parent d8153d4 commit dba6f9b
3 files changed
Lines changed: 82 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2673 | 2673 | | |
2674 | 2674 | | |
2675 | 2675 | | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
2676 | 2679 | | |
2677 | 2680 | | |
2678 | 2681 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
343 | 344 | | |
344 | 345 | | |
345 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
346 | 353 | | |
347 | 354 | | |
348 | 355 | | |
| |||
577 | 584 | | |
578 | 585 | | |
579 | 586 | | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
580 | 592 | | |
581 | 593 | | |
582 | 594 | | |
| |||
1164 | 1176 | | |
1165 | 1177 | | |
1166 | 1178 | | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
1167 | 1186 | | |
1168 | 1187 | | |
1169 | 1188 | | |
| |||
1353 | 1372 | | |
1354 | 1373 | | |
1355 | 1374 | | |
| 1375 | + | |
| 1376 | + | |
1356 | 1377 | | |
1357 | 1378 | | |
1358 | 1379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
91 | 93 | | |
92 | 94 | | |
93 | 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 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
94 | 152 | | |
95 | 153 | | |
96 | 154 | | |
0 commit comments