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

Ayush Saxena commented on HDFS-16222:
-------------------------------------

Attached a test to repro.

Tried a quick fix, Seems the problem is with {{getMountPathInfo}}, it ignores 
the path from {{ChRootedFileSystem}}, Changed this method, and things worked as 
expected for me.

{code:java}
  public MountPathInfo<FileSystem> getMountPathInfo(Path path,
      Configuration conf) throws IOException {
    InodeTree.ResolveResult<FileSystem> res;
    try {

      res = fsState.resolve(getUriPath(path), true);
      FileSystem fs = res.isInternalDir() ?
          (fsState.getRootFallbackLink() != null ?
              fsState.getRootFallbackLink().getTargetFileSystem() :
              fsGetter().get(path.toUri(), conf)) :
          res.targetFileSystem;
      if (fs instanceof ChRootedFileSystem) {
        ChRootedFileSystem chFs = (ChRootedFileSystem) fs;
        return new MountPathInfo<>(chFs.fullPath(res.remainingPath),
            chFs.getMyFs());
      }

      return new MountPathInfo<FileSystem>(res.remainingPath, fs);
    } catch (FileNotFoundException e) {
      // No link configured with passed path.
      throw new NotInMountpointException(path,
          "No link found for the given path.");
    }
  }
{code}

Need to check a bit more, Might have messed up. :-) 

> Fix ViewDFS with mount points for HDFS only API
> -----------------------------------------------
>
>                 Key: HDFS-16222
>                 URL: https://issues.apache.org/jira/browse/HDFS-16222
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Major
>         Attachments: test_to_repro.patch
>
>
> Presently, For HDFS specific API, The resolved path seems to be coming wrong.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to