Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINIFICPP-748 - Nanofi: add custom C processor example #499

Closed
wants to merge 1 commit into from

Conversation

arpadboda
Copy link
Contributor

Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically master)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


char md5value[50];

snprintf(md5value, attr.value_size, "%s", (const char*)attr.value+1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a user I find it pretty painful to use.
@phrocker I think we should consider changing values to "const char *"
Not sure what's the right timing for that release-wise.
If I remember well we already have a Jira for that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree -- and no objection from my side since it's an internal struct and assignment likely wouldn't cause any impact to currently existing code.

You're right though, I do think there may be a JIRA for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just found this: https://issues.apache.org/jira/browse/MINIFICPP-646
This might fit.

However my question was mostly about timing: this is most probably going to be a breaking change in the API and 0.6.0 is to be released soon, I wonder if we try to add it or do it later in 0.7.0 or 1.0? The later we do it the more we break.

*content_repo);
auto stream = (*content_repo)->read(claim);
return stream->read(target, size);
} else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that ff->contentlocation is used for two different purpose:
-A simple filename to show where the content of the flowfile in the filesystem is
-An internal string that represent the location of the file within the content repo

I think this should be separated.
@phrocker do you have any longer term plan to resolve this in nanofi?

Copy link
Contributor

@phrocker phrocker Mar 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imagine if there were no c++ involved, and as a result, no content repo, would that change your concern?

Is this not an internal struct? it's fair to expect interaction with our structures to not be raw access. As a result it's also fair to add a temporary item while content-repo is in existence. I'll leave that up to you, but maybe we should make clear that the FF object is not intended to be access outside of the bounds of function accessors?

Copy link
Contributor Author

@arpadboda arpadboda Mar 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 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.

@asfgit asfgit closed this in b5e47b8 Mar 15, 2019
nghiaxlee pushed a commit to nghiaxlee/nifi-minifi-cpp that referenced this pull request Jul 8, 2019
This closes apache#499.

Signed-off-by: Marc Parisi <phrocker@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants