turcsanyip commented on a change in pull request #4273:
URL: https://github.com/apache/nifi/pull/4273#discussion_r425910853



##########
File path: 
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/FetchAzureDataLakeStorage.java
##########
@@ -67,6 +67,10 @@ public void onTrigger(ProcessContext context, ProcessSession 
session) throws Pro
             final DataLakeDirectoryClient directoryClient = 
dataLakeFileSystemClient.getDirectoryClient(directory);
             final DataLakeFileClient fileClient = 
directoryClient.getFileClient(fileName);
 
+            if (fileClient.getProperties().isDirectory()) {

Review comment:
       I can see a possible optimization here.
   According to @MuazmaZ's comment 
(https://github.com/apache/nifi/pull/4257#discussion_r423930566), 
`get***Client()` does not involve a network call but `getProperties()` does.
   Most of the cases, this call would not be needed, because when the returned 
entity has content, it is definitely not a directory but a file. So I think 
this check could be moved after `session.write()` (line 74) and it needs to be 
checked only when the resulted flowfile is empty.
   @pgyori, @MuazmaZ: what is your opinion?




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