hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manoj Govindassamy (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-5692) viewfs shows resolved path in FileNotFoundException
Date Sat, 12 Nov 2016 07:50:58 GMT

    [ https://issues.apache.org/jira/browse/HDFS-5692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15659241#comment-15659241
] 

Manoj Govindassamy commented on HDFS-5692:
------------------------------------------

Thanks for the comment. Yes, it is possible to create a new exception by extending FileNotFoundException
and later doing initCause(). The only problem here is the top level exception will again be
the custom one and not the FileNotFoundException. try/catch would still work though. The reluctance
to go this route is that the new custom exception is not a well known one and would end up
more specific to {{listStatus}} API. Would be preferable to throw either the well known Exceptions
or the other FileSystem/ViewFileSystem publicly exposed ones. There is {{NotInMointPointException}}
which is already available under {{ViewFileSystem}} and closest match for the errors relating
to {{Path}}. The current definition of {{NotInMountPointException}} doesn't accept a throwable,
but it should be doable. The real question here is would any other Exception match the correctness
as in FileNotFoundException. Any further thoughts on this please ?

> viewfs shows resolved path in FileNotFoundException
> ---------------------------------------------------
>
>                 Key: HDFS-5692
>                 URL: https://issues.apache.org/jira/browse/HDFS-5692
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs-client
>    Affects Versions: 2.2.0
>            Reporter: Keith Turner
>            Assignee: Manoj Govindassamy
>
> 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.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message