Keith Turner created HDFS-5692: ---------------------------------- Summary: viewfs shows resolved path in FileNotFoundException Key: HDFS-5692 URL: https://issues.apache.org/jira/browse/HDFS-5692 Project: Hadoop HDFS Issue Type: Bug Affects Versions: 2.2.0 Reporter: Keith Turner
With the following config, if I call fs.listStatus("/nn1/a/b") when {{/nn1/a/b}} does not exist then ... {noformat} <configuration> <property> <name>fs.default.name</name> <value>viewfs:///</value> </property> <property> <name>fs.viewfs.mounttable.default.link./nn1</name> <value>hdfs://host1:9000</value> </property> <property> <name>fs.viewfs.mounttable.default.link./nn2</name> <value>hdfs://host2:9000</value> </property> </configuration> {noformat} I will see an error message like the following. {noformat} java.io.FileNotFoundException: File /a/b does not exist. at org.apache.hadoop.hdfs.DistributedFileSystem.listStatusInternal(DistributedFileSystem.java:644) at org.apache.hadoop.hdfs.DistributedFileSystem.access$600(DistributedFileSystem.java:92) at org.apache.hadoop.hdfs.DistributedFileSystem$14.doCall(DistributedFileSystem.java:702) at org.apache.hadoop.hdfs.DistributedFileSystem$14.doCall(DistributedFileSystem.java:698) at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) at org.apache.hadoop.hdfs.DistributedFileSystem.listStatus(DistributedFileSystem.java:698) at org.apache.hadoop.fs.FilterFileSystem.listStatus(FilterFileSystem.java:222) at org.apache.hadoop.fs.viewfs.ChRootedFileSystem.listStatus(ChRootedFileSystem.java:228) at org.apache.hadoop.fs.viewfs.ViewFileSystem.listStatus(ViewFileSystem.java:366) {noformat} I think it would be useful for ViewFS to wrap the FileNotFoundException from the inner filesystem, giving an error message like the following. The following error message has the resolved and unresolved paths which is very useful for debugging. {noformat} java.io.FileNotFoundException: File /nn1/a/b does not exist. at org.apache.hadoop.fs.viewfs.ViewFileSystem.listStatus(ViewFileSystem.java:366) Caused by: java.io.FileNotFoundException: File /a/b does not exist. at org.apache.hadoop.hdfs.DistributedFileSystem.listStatusInternal(DistributedFileSystem.java:644) at org.apache.hadoop.hdfs.DistributedFileSystem.access$600(DistributedFileSystem.java:92) at org.apache.hadoop.hdfs.DistributedFileSystem$14.doCall(DistributedFileSystem.java:702) at org.apache.hadoop.hdfs.DistributedFileSystem$14.doCall(DistributedFileSystem.java:698) at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) at org.apache.hadoop.hdfs.DistributedFileSystem.listStatus(DistributedFileSystem.java:698) at org.apache.hadoop.fs.FilterFileSystem.listStatus(FilterFileSystem.java:222) at org.apache.hadoop.fs.viewfs.ChRootedFileSystem.listStatus(ChRootedFileSystem.java:228) at org.apache.hadoop.fs.viewfs.ViewFileSystem.listStatus(ViewFileSystem.java:366) {noformat} -- This message was sent by Atlassian JIRA (v6.1.4#6159)