adenes commented on a change in pull request #4792:
URL: https://github.com/apache/nifi/pull/4792#discussion_r569276813



##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TailFile.java
##########
@@ -1184,7 +1191,15 @@ private boolean recoverRolledFiles(final ProcessContext 
context, final ProcessSe
                             // This is the same file that we were reading when 
we shutdown. Start reading from this point on.
                             rolledOffFiles.remove(0);
                             FlowFile flowFile = session.create();
-                            flowFile = session.importFrom(in, flowFile);
+                            try {

Review comment:
       Thanks @Lehel44 for the suggestion.
   Although I agree that the method gets more and more complicated but I tried 
to extract these lines to a separate method and unless I do a bigger refactor 
it doesn't really simplify things.
   My biggest concern with it that the new method needs 5 parameters 
(`ProcessContext context, ProcessSession session, List<File> rolledOffFiles, 
File file, FileInputStream fis`) and there's no good way to check whether the 
`FileInputStream` belongs to the given `File`.
   
   It'd be definitely worth to do a bigger refactor on this method, but I'd 
suggest doing it in a separate PR.




----------------------------------------------------------------
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]


Reply via email to