| 386 | } |
| 387 | |
| 388 | bool DataProcessorService::outputNameInUse(const std::string& name, const std::string& except_key) const { |
| 389 | // Another transform already outputs this name? |
| 390 | for (const auto& [key, recipe] : transform_recipes_) { |
| 391 | if (key == except_key) { |
| 392 | continue; |
| 393 | } |
| 394 | if (std::find(recipe.outputs.begin(), recipe.outputs.end(), name) != recipe.outputs.end()) { |
| 395 | return true; |
| 396 | } |
| 397 | } |
| 398 | // A live engine topic (source / filter output / other node) has this name, and it |
| 399 | // is not this transform's own current output (so an in-place replace is allowed)? |
| 400 | std::unordered_set<TopicId> own_outputs; |
| 401 | if (const auto it = transform_recipes_.find(except_key); it != transform_recipes_.end()) { |
| 402 | own_outputs.insert(it->second.output_topic_ids.begin(), it->second.output_topic_ids.end()); |
| 403 | } |
| 404 | for (const DatasetId ds : engine_.listDatasets()) { |
| 405 | for (const TopicId tid : engine_.listTopics(ds)) { |
| 406 | if (own_outputs.count(tid) > 0) { |
| 407 | continue; |
| 408 | } |
| 409 | const TopicStorage* storage = engine_.getTopicStorage(tid); |
| 410 | if (storage != nullptr && storage->descriptor().name == name) { |
| 411 | return true; |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | return false; |
| 416 | } |
| 417 | |
| 418 | Status DataProcessorService::validateScript( |
| 419 | std::string_view script, std::string_view language, std::string_view params_json) { |
nothing calls this directly
no test coverage detected