[ 
https://issues.apache.org/jira/browse/NIFI-13288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852051#comment-17852051
 ] 

ASF subversion and git services commented on NIFI-13288:
--------------------------------------------------------

Commit 6ca03eae5523c21820af40b215e3f8bb3aecb879 in nifi's branch 
refs/heads/main from dan-s1
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=6ca03eae55 ]

NIFI-13288 Improved SplitXml and SplitAvro to call session.putAttributes()

This closes #8917

Signed-off-by: David Handermann <exceptionfact...@apache.org>


> Fix SplitXml, and SplitAvro processors not to call session.putAttribute 
> multiple times
> --------------------------------------------------------------------------------------
>
>                 Key: NIFI-13288
>                 URL: https://issues.apache.org/jira/browse/NIFI-13288
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Daniel Stieglitz
>            Assignee: Daniel Stieglitz
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Per [~markap14] in the following 
> [post|https://lists.apache.org/thread/7zo2px31r3377c7vhby4h6nrngdf3llf] one 
> should avoid calling  session.putAttribute many times since  in order to 
> maintain object immutability it has to create a new FlowFile object (and a 
> new HashMap of all attributes!)
> for every call to session.putAttribute which leads to potentially a huge 
> amount of garbage getting created.  Some of the split processors SplitXml and 
> SplitAvro all have loops to create a new flow file for each split and it 
> calls session.putAttribute more than once (in order to populate the split 
> attributes FRAGMENT_ID, FRAGMENT_INDEX etc)  for each flow file created. Per 
> Mark's advice, these should be fixed to to populate the attributes in a Map 
> and then make one call to session.putAllAttributes.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to