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

Andrew Wang commented on HADOOP-13885:
--------------------------------------

Hi Manoj, thanks for working on this. IIUC getLinkTarget is supposed to return 
the link untouched, per this description in FileContext:

{noformat}
   * Returns the target of the given symbolic link as it was specified
   * when the link was created.  Links in the path leading up to the
   * final path component are resolved transparently.
{noformat}

The implementation of getLinkTarget looks like it munges the path in some way. 
Note that symlinks can point to other filesystems, and can also be relative. 
The true location of the target depends on the mounts, and it's on the link 
resolver (not getLinkTarget) to further resolve links. I don't think we 
implemented symlink support for ViewFileSystem though, so this is somewhat moot.

Sorry for not seeing these before, but I'm confused about how here (and 
elsewhere in VFS) we catch exceptions and turn them into a 
NotInMountPointException. Don't users expect an FNF if the link doesn't exist? 
A lot of methods just delegate directly to the targetFileSystem instead.

In the test, we can also use {{assume}} from JUnit to skip if the test isn't 
applicable. It'd also be good to test relative and cross FS symlinks, for some 
additional completeness.

> Implement getLinkTarget for ViewFileSystem
> ------------------------------------------
>
>                 Key: HADOOP-13885
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13885
>             Project: Hadoop Common
>          Issue Type: Task
>          Components: viewfs
>    Affects Versions: 3.0.0-alpha1
>            Reporter: Manoj Govindassamy
>            Assignee: Manoj Govindassamy
>         Attachments: HADOOP-13885.01.patch
>
>
> ViewFileSystem doesn't override FileSystem#getLinkTarget(). So, when view 
> filesystem is used to resolve the symbolic links, the default FileSystem 
> implementation throws UnsupportedOperationException.
> The proposal is to define getLinkTarget() for ViewFileSystem and invoke the 
> target FileSystem for resolving the symbolic links. Path thus returned is 
> preferred to be a viewfs qualified path, so that it can be used again on the 
> ViewFileSystem handle. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to