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

ASF GitHub Bot commented on NIFI-3249:
--------------------------------------

Github user JPercivall commented on the issue:

    https://github.com/apache/nifi/pull/1356
  
    Sorry @brosander but I was a bit wrong when talking about the ordering of 
the Delete; I should have tested first. 
    
    It appears that instead of deleting both attributes that were initially 
there and new attributes, it only deletes already present attributes. That is 
because, although it does the delete after the addAttribute, the regex is only 
run on the attributes that already existed[1]. So again it does keep the same 
ordering as before but it's contrary to what we though.
    
    Everything else looks good though. If you could change the documentation 
(and maybe throw in a unit test) for the delete ordering I will +1 and merge.
    
    [1] 
https://github.com/apache/nifi/blob/b519204602a5bd40f219f77ac556563010eca4c1/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java#L601-L601


> UpdateAttribute performance improvements
> ----------------------------------------
>
>                 Key: NIFI-3249
>                 URL: https://issues.apache.org/jira/browse/NIFI-3249
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Bryan Rosander
>            Assignee: Bryan Rosander
>            Priority: Minor
>         Attachments: after.png, before.png
>
>
> UpdateAttribute does a lot of work in every onTrigger() that it doesn't need 
> to.
> The default actions map can be built at schedule time so that it doesn't need 
> to be done on every trigger.
> getPropertyValue() can be implemented using ConcurrentMap.computeIfAbsent()
> Update actions can be ignored if there is a delete action for the same 
> attribute.
> Only need to call processSession.updateAttributes() and 
> processSession.deleteAttributes() if there are attributes to update and 
> delete respectively.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to