MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / invoke_ff

Function invoke_ff

nanofi/src/api/nanofi.cpp:689–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687
688
689flow_file_record *invoke_ff(standalone_processor* proc, const flow_file_record *input_ff) {
690 if (proc == nullptr) {
691 return nullptr;
692 }
693 auto plan = ExecutionPlan::getPlan(proc->getUUID());
694 if (!plan) {
695 // This is not a standalone processor, shouldn't be used with invoke!
696 return nullptr;
697 }
698
699 plan->reset();
700
701 if (input_ff) {
702 auto content_repo = static_cast<std::shared_ptr<minifi::core::ContentRepository> *>(input_ff->crp);
703 auto ff_data = std::make_shared<flowfile_input_params>();
704
705 if(input_ff->crp && (*content_repo)) {
706 std::shared_ptr<minifi::ResourceClaim> claim = std::make_shared<minifi::ResourceClaim>(input_ff->contentLocation,
707 *content_repo);
708 ff_data->content_stream = (*content_repo)->read(*claim);
709 } else {
710 ff_data->content_stream = std::make_shared<minifi::io::BufferStream>();
711 file_buffer fb = file_to_buffer(input_ff->contentLocation);
712 ff_data->content_stream->write(fb.buffer, gsl::narrow<int>(fb.file_len));
713 free(fb.buffer);
714 }
715
716 ff_data->attributes = *static_cast<AttributeMap*>(input_ff->attributes);
717 plan->runNextProcessor(nullptr, ff_data);
718 }
719 while (plan->runNextProcessor()) {
720 }
721 return flowfile_to_record(plan->getCurrentFlowFile(), plan.get());
722}
723
724flow_file_record *invoke_chunk(standalone_processor* proc, uint8_t* buf, uint64_t size) {
725 if (proc == nullptr || buf == nullptr || size == 0) {

Callers 3

invokeFunction · 0.85
CAPITests.cppFile · 0.85
mainFunction · 0.85

Calls 9

file_to_bufferFunction · 0.85
flowfile_to_recordFunction · 0.85
getUUIDMethod · 0.45
resetMethod · 0.45
readMethod · 0.45
writeMethod · 0.45
runNextProcessorMethod · 0.45
getCurrentFlowFileMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected