arpadboda commented on a change in pull request #613: Minificpp 927 Nanofi
tailfile delimited processor
URL: https://github.com/apache/nifi-minifi-cpp/pull/613#discussion_r308781212
##########
File path: nanofi/src/api/nanofi.cpp
##########
@@ -245,28 +262,55 @@ flow_file_record* create_ff_object_nc() {
return new_ff;
}
-flow_file_record * generate_flow_file(nifi_instance * instance,
standalone_processor * proc) {
- if (!instance || !proc) {
- return nullptr;
- }
+flow_file_record * generate_flow(processor_context * ctx) {
flow_file_record * ffr = create_ff_object_nc();
- auto minifi_instance_ref =
static_cast<minifi::Instance*>(instance->instance_ptr);
- auto content_repo = minifi_instance_ref->getContentRepository();
+ ffr->crp = static_cast<void*>(new
std::shared_ptr<minifi::core::ContentRepository>(ctx->getContentRepository()));
+
+ auto plan =
ExecutionPlan::getPlan(ctx->getProcessorNode()->getProcessor()->getUUIDStr());
- ffr->crp = static_cast<void*>(new
std::shared_ptr<minifi::core::ContentRepository>(content_repo));
- auto plan = ExecutionPlan::getPlan(proc->getUUIDStr());
if (!plan) {
return nullptr;
}
ffr->ffp = static_cast<void*>(new
std::shared_ptr<core::FlowFile>(plan->getCurrentFlowFile()));
ffr->keepContent = 1;
auto ff_content_repo_ptr =
(static_cast<std::shared_ptr<minifi::core::ContentRepository>*>(ffr->crp));
auto claim = std::make_shared<minifi::ResourceClaim>(*ff_content_repo_ptr);
- const char * full_path = claim->getContentFullPath().c_str();
- int len = strlen(full_path);
- ffr->contentLocation = (char *) malloc(sizeof(char) * (len + 1));
- snprintf(ffr->contentLocation, len + 1, "%s", full_path);
+
+ int len = strlen(claim->getContentFullPath().c_str());
Review comment:
size_t pls
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services