[
https://issues.apache.org/jira/browse/HADOOP-18537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17638635#comment-17638635
]
Steve Loughran edited comment on HADOOP-18537 at 11/25/22 11:35 AM:
--------------------------------------------------------------------
filesystem.md covers create()
```
forall d = ancestors(FS, p) :
if exists(FS, d) and not isDir(FS, d) :
raise [ParentNotDirectoryException, FileAlreadyExistsException,
IOException]
```
it just says "no parents must be files". And we don't check that for
performance reasons.
*nobody has ever noticed this fact in production*.
if you create a file in s3, it creates an object with the a path /a/b/c .txt so
the parent directories "implicitly" appear
bq. If we delete this key "/a/b/c.txt", "a" and "b" directories are all gone
disappear.
if you delete that file, there is a check in to see if a parent dir marker
needs to be created, {{maybeCreateFakeParentDirectory()}}.
try it!
was (Author: [email protected]):
filesystem.md covers create()
```
forall d = ancestors(FS, p) :
if exists(FS, d) and not isDir(FS, d) :
raise [ParentNotDirectoryException, FileAlreadyExistsException,
IOException]
```
it just says "no parents must be files". And we don't check that for
performance reasons.
*nobody has ever noticed this fact in production*.
# if you create a file in s3, it creates an object with the a path /a/b/c .txt
so the parent directories "implicitly" appear
bq. If we delete this key "/a/b/c.txt", "a" and "b" directories are all gone
disappear.
if you delete that file, there is a check in to see if a parent dir marker
needs to be created, {{maybeCreateFakeParentDirectory()}}.
try it!
> S3A create(Path f, FsPermission permission) need create target middle
> directories?
> -----------------------------------------------------------------------------------
>
> Key: HADOOP-18537
> URL: https://issues.apache.org/jira/browse/HADOOP-18537
> Project: Hadoop Common
> Issue Type: Improvement
> Components: fs/s3
> Reporter: TongMingda
> Priority: Major
>
> I see the code of s3a create(Path f, etc) which does not create target middle
> directories,
> So whether exist this one case in which I create only one file "/a/b/c.txt",
> It can get "b" as a directory by list "/a/", but If we delete this key
> "/a/b/c.txt", "a" and "b" directories are all gone disappear.
> In the end, I want to ask two questions
> 1) Whether HCFS interface create(Path f, etc) need to create target middle
> directories inside?(sorry did not find doc to say about this)
> 2) If not create target middle directories inside, Is the object storage(s3a)
> scenario described above plausible?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]