[
https://issues.apache.org/jira/browse/NIFI-784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14693667#comment-14693667
]
ASF GitHub Bot commented on NIFI-784:
-------------------------------------
Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/71#discussion_r36872857
--- Diff:
nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnAttribute.java
---
@@ -236,7 +259,7 @@ public void onTrigger(final ProcessContext context,
final ProcessSession session
// now transfer any clones generated
for (final Map.Entry<Relationship, FlowFile> entry :
transferMap.entrySet()) {
- logger.info(this + " cloned " + flowFile + " into " +
entry.getValue() + " and routing clone to relationship " + entry.getKey());
+ logger.info("Cloned {} into {} and routing clone to
relationship {}", new Object[]{ flowFile, entry.getValue(), entry.getKey() });
--- End diff --
@madrob the ProcessorLog that is used here automatically adds it in so that
it is done consistently and without the developers having to remember to log
it. So if we add 'this' to the beginning, it ends up getting logged twice.
> Improve performance of RouteOnAttribute
> ---------------------------------------
>
> Key: NIFI-784
> URL: https://issues.apache.org/jira/browse/NIFI-784
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Reporter: Brian Ghigiarelli
> Labels: beginner, newbie
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> RouteOnAttribute has a couple inefficiencies:
> * Recalculating the dynamic properties into a HashMap for each message in
> onTrigger when this property map can be pre-computed when the processor is
> scheduled
> * Logger statements are concatenating strings instead of using lazy
> evaluation with a string formatter
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)