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

Abhishek Das commented on HADOOP-17032:
---------------------------------------

[~ste...@apache.org] There would be recursive call, but that won't go from one 
file system to another. I should also mention ViewFs in the title of the Jira 
to avoid confusion.

In case of multiple leaf nodes pointing to different filesystems, the current 
implementation of ViewFileSystem resolves the path only once and calls 
getContentSummary for the resolved filesystem.
{code:java}
@Override
public ContentSummary getContentSummary(Path f) throws IOException {
 InodeTree.ResolveResult<FileSystem> res =
 fsState.resolve(getUriPath(f), true);
 return res.targetFileSystem.getContentSummary(res.remainingPath);
}{code}
So, for a non-leaf nodes, the it cannot invoke the the method of corresponding 
fileSystem pointed by the leaf node.

For the same reason, the current implementation fails for the following 
scenario scenario:
{code:java}
ContentSummary summary = fsView.getContentSummary(new 
Path("/internalDir"));{code}
where "/internalDir" is a non-leaf directory and it has a child 

"/internalDir/linternalDir2" (a non-leaf node) and /internalDir/linkToDir2 (a 
leaf node) that points to dir2

> Handle a internal dir in viewfs having multiple children mount points 
> pointing to different filesystems
> -------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-17032
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17032
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs, viewfs
>            Reporter: Abhishek Das
>            Priority: Major
>
> In case the viefs mount table is configured in a way where multiple child 
> mount points are pointing to different file systems, the getContentSummary or 
> getStatus don't return the expected result
> {code:java}
> mount link /a/b/ → hdfs://nn1/a/b
>  mount link /a/d/ → file:///nn2/c/d{code}
> b has two files and d has 1 file. So getContentSummary on / should return 3 
> files.
> It also fails for the following scenario:
> {code:java}
> mount link  /internalDir -> /internalDir/linternalDir2
> mount link  /internalDir -> /internalDir/linkToDir2 -> hdfs://nn1/dir2{code}
> Exception:
> {code:java}
> java.io.IOException: Internal implementation error: expected file name to be 
> /java.io.IOException: Internal implementation error: expected file name to be 
> /
>  at 
> org.apache.hadoop.fs.viewfs.InternalDirOfViewFs.checkPathIsSlash(InternalDirOfViewFs.java:88)
>  at 
> org.apache.hadoop.fs.viewfs.InternalDirOfViewFs.getFileStatus(InternalDirOfViewFs.java:154)
>  at org.apache.hadoop.fs.FileSystem.getContentSummary(FileSystem.java:1684) 
> at org.apache.hadoop.fs.FileSystem.getContentSummary(FileSystem.java:1695) at 
> org.apache.hadoop.fs.viewfs.ViewFileSystem.getContentSummary(ViewFileSystem.java:918)
>  at 
> org.apache.hadoop.fs.viewfs.ViewFileSystemBaseTest.testGetContentSummary(ViewFileSystemBaseTest.java:1106){code}



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

---------------------------------------------------------------------
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