[
https://issues.apache.org/jira/browse/HADOOP-8040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13607949#comment-13607949
]
Andrew Wang commented on HADOOP-8040:
-------------------------------------
Hi Daryn, thanks for taking a look.
This patch only adds symlink support to {{DistributedFileSystem}} and
{{LocalFileSystem}}. Other filesystems will throw
{{UnsupportedOperationException}}s. It's going to be tricky to add support to
{{ViewFileSystem}} and {{ChRootedFileSystem}} without a internal/external
interface split like in FileContext/AbstractFileSystem, since just calling the
underlying filesystem's methods will lead to internal resolution. I think this
could be fixed by checking paths first with {{FileSystem#resolveLink}}, or
substituting in a viewfs-specific {{FSLinkResolver}} in the underlying FSs,
which, instead of qualifying against the underlying FS, qualify against the
viewfs.
Perhaps we can revisit that in another JIRA, I think this is pretty useful with
just {{DFS}} support.
Relative symlinks are tested in {{SymlinkBaseTest}}, and I believe handled
correctly. Symlink targets are saved as specified at creation. Resolution
happens in {{FSLinkResolver#resolve}}: we fully qualify relative link targets
against their containing filesystem, then try the call again with the new
fully-qualified {{Path}}.
> Add symlink support to FileSystem
> ---------------------------------
>
> Key: HADOOP-8040
> URL: https://issues.apache.org/jira/browse/HADOOP-8040
> Project: Hadoop Common
> Issue Type: New Feature
> Components: fs
> Affects Versions: 0.23.0, 3.0.0, 2.0.3-alpha
> Reporter: Eli Collins
> Assignee: Andrew Wang
> Attachments: hadoop-8040-1.patch, hadoop-8040-2.patch
>
>
> HADOOP-6421 added symbolic links to FileContext. Resolving symlinks is done
> on the client-side, and therefore requires client support. An HDFS symlink
> (created by FileContext) when accessed by FileSystem will result in an
> unhandled UnresolvedLinkException. Because not all users will migrate from
> FileSystem to FileContext in lock step, and we want users of FileSystem to be
> able to access all paths created by FileContext, we need to support symlink
> resolution in FileSystem as well, to facilitate migration to FileContext.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira