ayushtkn commented on a change in pull request #2061:
URL: https://github.com/apache/hadoop/pull/2061#discussion_r436466673
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
##########
@@ -1202,19 +1202,18 @@ public FileStatus getFileStatus(Path f) throws
IOException {
INodeLink<FileSystem> link = (INodeLink<FileSystem>) inode;
try {
String linkedPath = link.getTargetFileSystem().getUri().getPath();
- if("".equals(linkedPath)) {
+ if ("".equals(linkedPath)) {
linkedPath = "/";
}
FileStatus status =
- ((ChRootedFileSystem)link.getTargetFileSystem())
- .getMyFs().getFileStatus(new Path(linkedPath));
- result[i++] = new FileStatus(status.getLen(), false,
- status.getReplication(), status.getBlockSize(),
- status.getModificationTime(), status.getAccessTime(),
- status.getPermission(), status.getOwner(), status.getGroup(),
- link.getTargetLink(),
- new Path(inode.fullPath).makeQualified(
- myUri, null));
+ ((ChRootedFileSystem) link.getTargetFileSystem()).getMyFs()
+ .getFileStatus(new Path(linkedPath));
+ result[i++] = new FileStatus(status.getLen(), status.isDirectory(),
+ status.getReplication(), status.getBlockSize(),
+ status.getModificationTime(), status.getAccessTime(),
+ status.getPermission(), status.getOwner(), status.getGroup(),
+ link.getTargetLink(),
+ new Path(inode.fullPath).makeQualified(myUri, null));
Review comment:
Here in the FileStatus we have resolved the mount and giving details of
the destination. Any idea where the link.getTargetLink() in the FileStatus can
be or is used?
If we are resolving the mount entry, This is actually the FileStatus of the
destination, if the destination itself is a symlink, in that case instead of
link.getTargetLink() shouldn't status.getSymlink() be done?
Since all the other details like permissions and stuff we are having of the
destination, the intent seems to resolve it as the destination directory rather
than projecting this as a symlink to the end user. else if we see in linux the
symlink doesn't shows the destination permission or other details it shows it's
own details while listing :
```
lrwxrwxrwx 1 ayush ayush 3 Jun 8 04:52 sym_f -> txt
-rw-rw-r-- 1 ayush ayush 0 Jun 8 11:05 txt
```
In RBF also for listing on mount points, we don't denote them as symlinks,
instead just pass the destination FileStatus with name resolved...
Is it possible we keep the assertions as it is and change
link.getTargetLink() and specify that as per the destination?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]