troywinter commented on a change in pull request #6461:
URL: https://github.com/apache/incubator-pinot/pull/6461#discussion_r559988191



##########
File path: 
pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java
##########
@@ -202,17 +202,20 @@ public void copyFromLocalFile(File srcFile, URI dstUri)
 
   @Override
   public boolean isDirectory(URI uri) {
-    FileStatus fileStatus = new FileStatus();
-    fileStatus.setPath(new Path(uri));
-    return fileStatus.isDirectory();
+    try {
+      return _hadoopFS.isDirectory(new Path(uri));

Review comment:
       hadoop's source code saying `True iff the named path is a directory. 
Note: Avoid using this method. Instead reuse the FileStatus returned by 
getFileStatus() or listStatus() methods.` Try using 
`_hadoopFS.getFileStatus(new Path(uri)).isDirectory();`




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to