| 284 | } |
| 285 | |
| 286 | std::vector<TopicId> DataEngine::commitChunksLocked( |
| 287 | std::vector<std::pair<TopicId, TopicChunk>> chunks) { // NOLINT(performance-unnecessary-value-param) |
| 288 | std::vector<TopicId> changed; |
| 289 | for (auto& [topic_id, chunk] : chunks) { |
| 290 | auto* storage = getTopicStorage(topic_id); |
| 291 | if (storage != nullptr) { |
| 292 | auto status = storage->appendSealedChunk(std::move(chunk)); |
| 293 | if (!status.has_value()) { |
| 294 | continue; // chunk rejected (e.g. out-of-order); do not mark topic as changed |
| 295 | } |
| 296 | // A topic that receives real data is no longer "absent": un-retire it so a |
| 297 | // recomputed filter output (retired by a reload's replaceDatasetFrom) reappears in |
| 298 | // listTopics()/the catalog once its fresh chunks land. Mirrors the un-retire-on- |
| 299 | // readopt at replaceDatasetFrom. |
| 300 | impl_->retired_topic_ids.erase(topic_id); |
| 301 | if (changed.empty() || changed.back() != topic_id) { |
| 302 | changed.push_back(topic_id); |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | // Deduplicate (flushAll() may emit multiple chunks for one topic). |
| 307 | std::sort(changed.begin(), changed.end()); |
| 308 | changed.erase(std::unique(changed.begin(), changed.end()), changed.end()); |
| 309 | return changed; |
| 310 | } |
| 311 | |
| 312 | void DataEngine::enforceRetention(Timestamp retention_window_ns) { |
| 313 | std::unique_lock<std::recursive_mutex> lock(impl_->mutex_); |
no test coverage detected