[
https://issues.apache.org/jira/browse/NIFI-3249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15780789#comment-15780789
]
ASF GitHub Bot commented on NIFI-3249:
--------------------------------------
Github user JPercivall commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1356#discussion_r93950599
--- Diff:
nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java
---
@@ -143,9 +144,10 @@ public ValidationResult validate(String subject,
String input, ValidationContext
}
};
+ public static final String DELETE_ATTRIBUTES_EXPRESSION_NAME = "Delete
Attributes Expression";
// static properties
public static final PropertyDescriptor DELETE_ATTRIBUTES = new
PropertyDescriptor.Builder()
- .name("Delete Attributes Expression")
+ .name(DELETE_ATTRIBUTES_EXPRESSION_NAME)
.description("Regular expression for attributes to be deleted
from FlowFiles.")
--- End diff --
I wanted to double check that the ordering of the delete vs update logic
was preserved with what was documented but it doesn't appear to be at all. Your
updates do seem to preserve the ordering as it was coded before (delete
supersedes everything) but could you add a note either here or in the
additional docs stating the intended order?
> 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)