瀏覽代碼

HADOOP-2432. HDFS includes the name of the file while throwing
"File does not exist" exception. (Jim Kellerman via dhruba)



git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@605457 13f79535-47bb-0310-9956-ffa450edef68

Dhruba Borthakur 17 年之前
父節點
當前提交
ca84b256ca
共有 3 個文件被更改,包括 5 次插入2 次删除
  1. 3 0
      CHANGES.txt
  2. 1 1
      src/java/org/apache/hadoop/dfs/FSDirectory.java
  3. 1 1
      src/java/org/apache/hadoop/dfs/HftpFileSystem.java

+ 3 - 0
CHANGES.txt

@@ -126,6 +126,9 @@ Trunk (unreleased changes)
     HADOOP-2326. The initial block report at Datanode startup time has
     a random backoff period.  (Sanjay Radia via dhruba)
 
+    HADOOP-2432. HDFS includes the name of the file while throwing 
+    "File does not exist"  exception. (Jim Kellerman via dhruba)
+
   OPTIMIZATIONS
 
     HADOOP-1898.  Release the lock protecting the last time of the last stack

+ 1 - 1
src/java/org/apache/hadoop/dfs/FSDirectory.java

@@ -486,7 +486,7 @@ class FSDirectory implements FSConstants {
     synchronized (rootDir) {
       INode targetNode = rootDir.getNode(srcs);
       if (targetNode == null) {
-        throw new IOException("File does not exist");
+        throw new IOException("File does not exist: " + srcs);
       }
       else {
         return new DFSFileInfo(srcs, targetNode);

+ 1 - 1
src/java/org/apache/hadoop/dfs/HftpFileSystem.java

@@ -177,7 +177,7 @@ public class HftpFileSystem extends FileSystem {
     public FileStatus getFileStatus(Path f) throws IOException {
       fetchList(f.toUri().getPath(), false);
       if (fslist.size() == 0) {
-        throw new IOException("File does not exist");
+        throw new IOException("File does not exist: " + f);
       }
       return fslist.get(0);
     }