[ https://issues.apache.org/jira/browse/HADOOP-6427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791050#action_12791050 ]
Eli Collins commented on HADOOP-6427: ------------------------------------- The isQualified test is an error check. Ideally the namenode resolves all links within the file system so all the UnresolvedLinkExceptions that FileContext sees have fully qualified targets. In the current patch the namenode throws an exception to the client even if the link is within the same file system, but even then we want to check that we got back a fully qualified path be clear that the interpretation of the link target is done by the AbstractFileSystem and not FileContext. So I think we need a function to determine if a path is fully qualified in any case right? It also serves to define what we mean by "fully qualified" in Path (this is currently defined implicitly in the makeQualfied method). I took your (excellent) suggestion of storing the link target verbatim but have the client return a fully qualified path. That's definitely the way to go. The current semantics follow, will update the design doc. All of these cases are now covered in individual tests in TestLink and TestLocalFsLink. * Relative link targets {{fc.createSymlink("file", "/dir/link")}} creates a link named "link" in /dir (assuming the current working directory is "/dir") that points to "file", eg resolves to "/dir/file", and if "dir" is renamed "dir2" the link resolves to "/dir2/link" because the path is not stored relative. The file context is determined by the parent of the link, eg the fully qualified path of the link target of "/dir/link" is determined by "/dir" not the file context that is used to access the link. * Absolute links targets {{fc.createSymlink("/dir/file", "/dir/link")}} creates a link named "link" in /dir that points to "/dir/file", if "dir" is renamed "dir2" the link becomes dangling because the link target is stored absolute. The file system is determined by the source not the client, eg {{fc.open("hdfs://host1/dir/link")}} opens "/dir/file" on host1 even if accessed using a local file context. * Fully qualified link targets {{fc.createSymlink("hdfs://host/dir/file", "/dir/link")}} creates a link named "link" in /dir that always points to the fully qualified path specified, regardless of the file context or path used to access the link. I updated the code in HADOOP-6421. > Add Path isQualified > -------------------- > > Key: HADOOP-6427 > URL: https://issues.apache.org/jira/browse/HADOOP-6427 > Project: Hadoop Common > Issue Type: Improvement > Reporter: Eli Collins > Assignee: Eli Collins > Attachments: hadoop-6427-1.patch > > > The Path class has a method to make a path qualified but not to query if the > path is qualified. This is needed for HADOOP-64221. In addition this patch > adds tests to TestPath that cover the file scheme. Note that "fully > qualified" applies to domain names not URIs so this function and it tests > also serve to define what we mean by a fully qualified path. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.