[
https://issues.apache.org/jira/browse/HADOOP-13734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15588501#comment-15588501
]
Steve Loughran commented on HADOOP-13734:
-----------------------------------------
There's a problem here in that Swift client uses an empty file as a marker for
"a directory"; there's no distinguishing of the two. This is something that S3N
initated, and which the SwiftFS copies.
If we pull it, stuff which looks for (empty) directories is going to break. e.g
{code}
Path path = new path("dir")
fs.mkdirs(path)
FileStatus stat = fs.getFileStatus(path)
assert(stat.isDirectory())
{code}
There's no easy answer here. S3A, for S3, uses files ending in "/" for
directory markers, which does provide more differentiation, but complicates
other things (a call to getFileStatus() takes 3 HTTP requests)
> ListStatus Returns Incorrect Result for Blank File
> --------------------------------------------------
>
> Key: HADOOP-13734
> URL: https://issues.apache.org/jira/browse/HADOOP-13734
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs/swift
> Reporter: Kevin Huang
>
> Reproduce steps:
> 1. Create a blank file on Swift via Swift client(e.g Cyberduck)
> 2. Use Hadoop Swift API to get file status. The following is the code example:
> {code}
> Configuration hadoopConf = new Configuration();
> hadoopConf.addResource("swift-site.xml"); // Set Swift configurations
> FileSystem fs = FileSystem.get(new
> URI("swift://containername.myprovider/"), hadoopConf);
> FileStatus[] statuses = fs.listStatus(new Path("/mydir"));
> for(FileStatus status : statuses) {
> System.out.println(status);
> }
> {code}
> Result:
> {code}
> SwiftFileStatus{ path=swift://bdd-edp.bddcs/mydir/blankfile;
> isDirectory=true; length=0; blocksize=33554432;
> modification_time=1476875293230}
> {code}
> API treated blankfile as a directory. That is incorrect.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]