hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Shvachko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-2634) Deprecate exists() and isDir() to simplify ClientProtocol.
Date Thu, 17 Jan 2008 21:52:34 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-2634?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560094#action_12560094

Konstantin Shvachko commented on HADOOP-2634:

- Right now getFileInfo() - an *HDFS* variant of getFileStatus() - throws
{code} IOException("File does not exist: " + srcs); {code}
- *LocalFileSystem* does not throw anything but actually returns a valid FileStatus with some
default values.
- *S3FileSystem* throws 
{code} IOException(f.toString() + ": No such file or directory."); {code} 
- And *kfs* does not seem to be throwing anything just like LocalFileSystem, please correct
me if I'm wrong.

So this is all really inconsistent. And to make it consistent I would vote for throwing rather
than returning null, but throwing FileNotFoundException instead of the base IOException. Then
it would make implementation of exists() rather simple.

> Deprecate exists() and isDir() to simplify ClientProtocol.
> ----------------------------------------------------------
>                 Key: HADOOP-2634
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2634
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: dfs
>    Affects Versions: 0.15.0
>            Reporter: Konstantin Shvachko
> ClientProtocol can be simplified by removing two methods
> {code}
> public boolean exists(String src) throws IOException;
> public boolean isDir(String src) throws IOException;
> {code}
> This is a redundant api, which can be implemented in DFSClient as convenience methods
> {code}
> public DFSFileInfo getFileInfo(String src) throws IOException;
> {code}
> Note that we already deprecated several Filesystem method and advised to use getFileStatus()
> Should we deprecate them in 0.16?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message