Hi, https://github.com/apache/nifi/pull/8968
This PR is a proposal to see if the PMC agrees with this API change. I have not written any new unit tests for this PR yet until I get buy-in on it. I added two new create methods to the API of ProcessSession to allow the option of passing in ff attributes to be added to the flow file being created. This is not a breaking change because the original create methods are still there. ProcessSession FlowFile create(FlowFile parent, final Map<String, String> attributes); FlowFile create(final Map<String, String> attributes); Changing a core API is a very significant change but I hope people will see it as worthwhile to allow us to to avoid creating an extra FlowFile object in many places that FlowFiles are created. Not all places set attributes right after \ FF creation, but very many of them do and could benefit. There are 150+ places where these new methods can be used and I only changed the GenerateTableFetch processor to call them so you how the new methods are used. I expect using these new create methods has the potential to avoid noticeable transient memory allocation like the earlier API addition of SessionContext.isAutoTerminated did. Also if this PR is approved, myself and others can change processors to call these new methods in a future PRs (not as part of this PR). Regards, Jim Steinebrey
