mgaido91 commented on a change in pull request #3597: NIFI-6462 ListHDFS should 
be triggerable
URL: https://github.com/apache/nifi/pull/3597#discussion_r306008418
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/ListHDFS.java
 ##########
 @@ -392,15 +404,24 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
 
         for (final FileStatus status : listable) {
             final Map<String, String> attributes = createAttributes(status);
-            FlowFile flowFile = session.create();
-            flowFile = session.putAllAttributes(flowFile, attributes);
+            FlowFile flowFile;
+            if (isTriggered) {
+                flowFile = 
session.putAllAttributes(session.create(originalFlowFile), attributes);
 
 Review comment:
   nit: here we can just have the creation of the `flowFile` and we can restore 
line 
https://github.com/apache/nifi/pull/3597/files#diff-4016ca1214c89d3709fb01745f784375L396
 which is common in the 2 cases

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to