You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/01/19 08:22:18 UTC

[GitHub] [incubator-pinot] troywinter commented on a change in pull request #6461: Fixing pinot hadoop fs isDirectory method

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org