[
https://issues.apache.org/jira/browse/HADOOP-9984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Nauroth updated HADOOP-9984:
----------------------------------
Attachment: HADOOP-9984.013.patch
Colin, what do you think of this new patch? This implements an idea suggested
by [~sureshms]. The base class still has an abstract {{listStatus}} that
subclasses need to implement. We add {{listLinkStatus}}, but it's not
abstract. If the underlying filesystem does not support symlinks, then it
overrides {{listStatus}} as appropriate, and inherits the default
implementation of {{listLinkStatus}}, which just delegates to {{listStatus}}.
If the underlying file system does support symlinks, then it overrides both
{{listLinkStatus}} and {{listStatus}}. To limit code duplication across the
subclasses, we provide a protected helper method in the base,
{{listStatusAndResolveSymlinks}}. File systems that support symlinks can call
up to this for an easy one-line implementation of {{listStatus}}.
This would be backwards-compatible. As a small side benefit, filesystems that
don't support symlinks wouldn't need to get involved with any "*Link" methods.
What do you think of this as a compromise? It helps control some of the bad
consequences discussed earlier.
> FileSystem#globStatus and FileSystem#listStatus should resolve symlinks by
> default
> ----------------------------------------------------------------------------------
>
> Key: HADOOP-9984
> URL: https://issues.apache.org/jira/browse/HADOOP-9984
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 2.1.0-beta
> Reporter: Colin Patrick McCabe
> Assignee: Colin Patrick McCabe
> Priority: Blocker
> Attachments: HADOOP-9984.001.patch, HADOOP-9984.003.patch,
> HADOOP-9984.005.patch, HADOOP-9984.007.patch, HADOOP-9984.009.patch,
> HADOOP-9984.010.patch, HADOOP-9984.011.patch, HADOOP-9984.012.patch,
> HADOOP-9984.013.patch
>
>
> During the process of adding symlink support to FileSystem, we realized that
> many existing HDFS clients would be broken by listStatus and globStatus
> returning symlinks. One example is applications that assume that
> !FileStatus#isFile implies that the inode is a directory. As we discussed in
> HADOOP-9972 and HADOOP-9912, we should default these APIs to returning
> resolved paths.
--
This message was sent by Atlassian JIRA
(v6.1#6144)