umamaheswararao commented on pull request #2061:
URL: https://github.com/apache/hadoop/pull/2061#issuecomment-640165012
Here is a draft patch to see how the yetus report for this change. I ran
locally some tests, most of them passed. Since it's in HADOOP, I don't think
HDFS tests will run. I ran few tests, most of them passed.
I have question on following assert:
In FileStatus.java:
```
// The variables isdir and symlink indicate the type:
// 1. isdir implies directory, in which case symlink must be null.
// 2. !isdir implies a file or symlink, symlink != null implies a
// symlink, otherwise it's a file.
assert (isdir && symlink == null) || !isdir;
```
This assert is telling that, if it's a dir, symlink should be null or it can
be a just file. This means, if it's a symlink, it can be only file.
I have tested in my macos about this semantics locally :
```
I have create symLink with srcLink --> target
lrwxr-xr-x 1 umagangumalla staff 6 Jun 6 15:54 srcLink -> target
//Like getFileStatus
System.out.println("===== Like getFileStatus ========");
System.out.println("path:"+java.nio.file.Paths.get("/Users/umagangumalla/Work/repos/PRs/srcLink"));
System.out.println("isDir:"+Files.isDirectory(java.nio.file.Paths.get("/Users/umagangumalla/Work/repos/PRs/srcLink")));
System.out.println("isSymlink:"+Files.isSymbolicLink(java.nio.file.Paths.get("/Users/umagangumalla/Work/repos/PRs/srcLink")
));
```
The output was:
===== Like getFileStatus ========
path:/Users/umagangumalla/Work/repos/PRs/srcLink
isDir:true
isSymlink:true
This says, isDir and isSymlink can be true. This patch supports this
behavior. So, I am not very sure on that assert, why that was added. I have
removed it to support this case now, otherwise, that assert will make flow fail
in dev envs. If someone knows about it, please comment. Thanks
CC: @shvachko @szetszwo @jnp @arp7
----------------------------------------------------------------
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]