| 722 | } |
| 723 | |
| 724 | flow_file_record *invoke_chunk(standalone_processor* proc, uint8_t* buf, uint64_t size) { |
| 725 | if (proc == nullptr || buf == nullptr || size == 0) { |
| 726 | return nullptr; |
| 727 | } |
| 728 | |
| 729 | auto plan = ExecutionPlan::getPlan(proc->getUUID()); |
| 730 | if (!plan) { |
| 731 | // This is not a standalone processor, shouldn't be used with invoke! |
| 732 | return nullptr; |
| 733 | } |
| 734 | |
| 735 | plan->reset(); |
| 736 | |
| 737 | auto ff_data = std::make_shared<flowfile_input_params>(); |
| 738 | ff_data->content_stream = std::make_shared<minifi::io::BufferStream>(); |
| 739 | ff_data->content_stream->write(buf, gsl::narrow<int>(size)); |
| 740 | |
| 741 | plan->runNextProcessor(nullptr, ff_data); |
| 742 | while (plan->runNextProcessor()) { |
| 743 | } |
| 744 | |
| 745 | return flowfile_to_record(plan->getCurrentFlowFile(), plan.get()); |
| 746 | } |
| 747 | |
| 748 | flow_file_record *invoke_file(standalone_processor* proc, const char* path) { |
| 749 | NULL_CHECK(nullptr, path, proc); |
no test coverage detected