You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xi...@apache.org on 2021/01/19 08:13:55 UTC

[incubator-pinot] 01/01: Fixing pinot hadoop fs isDirectory method

This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch fixing_hadoopfs_isDirectory
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 2050c219972f8785a7721bd403ed28f19470e661
Author: Xiang Fu <fx...@gmail.com>
AuthorDate: Tue Jan 19 00:13:32 2021 -0800

    Fixing pinot hadoop fs isDirectory method
---
 .../org/apache/pinot/plugin/filesystem/HadoopPinotFS.java     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java b/pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java
index 4024929..b1948bd 100644
--- a/pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java
+++ b/pinot-plugins/pinot-file-system/pinot-hdfs/src/main/java/org/apache/pinot/plugin/filesystem/HadoopPinotFS.java
@@ -202,9 +202,12 @@ public class HadoopPinotFS extends PinotFS {
 
   @Override
   public boolean isDirectory(URI uri) {
-    FileStatus fileStatus = new FileStatus();
-    fileStatus.setPath(new Path(uri));
-    return fileStatus.isDirectory();
+    try {
+      _hadoopFS.isDirectory(new Path(uri));
+    } catch (IOException e) {
+      LOGGER.error("Could not check isDirectory for {}", uri, e);
+      throw new RuntimeException(e);
+    }
   }
 
   @Override
@@ -212,7 +215,7 @@ public class HadoopPinotFS extends PinotFS {
     try {
       return _hadoopFS.getFileStatus(new Path(uri)).getModificationTime();
     } catch (IOException e) {
-      LOGGER.error("Could not get file status for {}", uri);
+      LOGGER.error("Could not get file status for {}", uri, e);
       throw new RuntimeException(e);
     }
   }


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