arpadboda commented on a change in pull request #499: MINIFICPP-748 - Nanofi:
add custom C processor example
URL: https://github.com/apache/nifi-minifi-cpp/pull/499#discussion_r265491457
##########
File path: nanofi/src/api/nanofi.cpp
##########
@@ -371,9 +371,18 @@ int8_t remove_attribute(flow_file_record *ff, const char
*key) {
int get_content(const flow_file_record* ff, uint8_t* target, int size) {
NULL_CHECK(0, ff, target);
auto content_repo =
static_cast<std::shared_ptr<minifi::core::ContentRepository>*>(ff->crp);
- std::shared_ptr<minifi::ResourceClaim> claim =
std::make_shared<minifi::ResourceClaim>(ff->contentLocation, *content_repo);
- auto stream = (*content_repo)->read(claim);
- return stream->read(target, size);
+ if(ff->crp && (*content_repo)) {
+ std::shared_ptr<minifi::ResourceClaim> claim =
std::make_shared<minifi::ResourceClaim>(ff->contentLocation,
+
*content_repo);
+ auto stream = (*content_repo)->read(claim);
+ return stream->read(target, size);
+ } else {
Review comment:
I wasn't aware of the Nanofi related visions here.
In case we don't plan to support content repo in Nanofi, just have flow
files store content in a simple file, that's fine. Although I would expect
people to in IoT world to use nanofi to trasmit data without any disk i/o
operations.
As this struct is most probably going to change anyway in the near future,
it's fine as is.
----------------------------------------------------------------
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