| 235 | // --------------------------------------------------------------------------- |
| 236 | |
| 237 | DataSourceRuntimeHost::DataSourceRuntimeHost( |
| 238 | DataEngine& engine, ExtensionCatalogService& catalog, DatasetId dataset_id, PJ_data_source_handle_t source_handle, |
| 239 | ObjectStore& object_store, std::string source_id, ObjectTopicParserRegistrar parser_registrar, |
| 240 | ObjectStore* secondary_object_store, DataEngine* secondary_data_engine, std::shared_ptr<void> library_keepalive) |
| 241 | : engine_(engine), |
| 242 | catalog_(catalog), |
| 243 | object_store_(object_store), |
| 244 | secondary_object_store_(secondary_object_store), |
| 245 | secondary_data_engine_(secondary_data_engine), |
| 246 | source_id_(std::move(source_id)), |
| 247 | object_topic_parser_registrar_(std::move(parser_registrar)), |
| 248 | dataset_id_(dataset_id), |
| 249 | source_write_host_(engine, source_handle), |
| 250 | source_object_write_host_(object_store, dataset_id), |
| 251 | lazy_fetch_mutex_(std::make_shared<std::mutex>()), |
| 252 | library_keepalive_(std::move(library_keepalive)) { |
| 253 | // Wire the source-level write host with the secondary engine for the |
| 254 | // streaming pause/resume two-engine lockstep. Without this, a plugin that |
| 255 | // caches TopicHandle/FieldHandle on start() (e.g. data_stream_dummy) sees |
| 256 | // them go stale after the first pause — the secondary engine has no |
| 257 | // matching ids — and the worker dies on the first post-pause write. |
| 258 | // Mirroring happens inside DatastoreSourceWriteHost via DataEngine's new |
| 259 | // createTopic(requested_id) + createTopicField(requested_id) primitives. |
| 260 | source_write_host_.setSecondaryEngine(secondary_data_engine_); |
| 261 | } |
| 262 | |
| 263 | DataSourceRuntimeHost::~DataSourceRuntimeHost() = default; |
| 264 |
nothing calls this directly
no test coverage detected