| 33 | DataProcessorService::~DataProcessorService() = default; |
| 34 | |
| 35 | Expected<DataProcessorService::FilterHandle> DataProcessorService::applyFilter( |
| 36 | TopicId input_topic_id, DatasetId dataset_id, std::string_view processor_id, std::string output_name, |
| 37 | std::size_t input_column_index) { |
| 38 | // Resolve the id to a Luau filter class through the installed catalogue. |
| 39 | std::unique_ptr<proc::DataProcessor> processor; |
| 40 | if (filter_catalogue_ && filter_catalogue_->find(processor_id) != nullptr) { |
| 41 | if (auto made = filter_catalogue_->makeProcessor(processor_id, "{}"); made.has_value()) { |
| 42 | processor = std::move(made).value(); |
| 43 | } |
| 44 | } |
| 45 | if (!processor) { |
| 46 | return PJ::unexpected("DataProcessorService: unknown processor id '" + std::string(processor_id) + "'"); |
| 47 | } |
| 48 | return applyFilter(input_topic_id, dataset_id, std::move(processor), std::move(output_name), input_column_index); |
| 49 | } |
| 50 | |
| 51 | Expected<DataProcessorService::FilterHandle> DataProcessorService::applyFilter( |
| 52 | TopicId input_topic_id, DatasetId dataset_id, std::unique_ptr<proc::DataProcessor> processor, |