EndzeitBegins commented on PR #8390:
URL: https://github.com/apache/nifi/pull/8390#issuecomment-1937723379

   Thank you for working on this @tombrisland.
   I'm really looking forward to this improvement and hope we can backport it 
to 1.x as well. 
   
   I haven't had time to do any testing, but just glanced over the code changes 
and they look straightforward.
   
   It seems that even though the `SFTPTransfer` supports the property already, 
the underlying `sshj` does not support a limit to `ls` directly but instead we 
rather stop adding results to our list. The listing is continued nonetheless. 
   I think supporting the property is still an improvement, as we at least can 
limit the amount of FlowFiles / records created this way. 
   
   However, I wonder if it makes sense to move the existing max result check
   ```Java
   if (listing.size() >= maxResults) {
       return false;
   }
   ```
   to the top of the `RemoteResourceFilter`? The limit only ever gets relevant, 
when there is a large amount of files at the remote source. Even though we 
cannot abort the listing prematurely, at least not without modifications to 
sshj, this way the checks needed for all files after the limit is reached is 
kept to a minimum.
   
   What do you think about that?


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to