[
https://issues.apache.org/jira/browse/HADOOP-12977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15530390#comment-15530390
]
Mingliang Liu commented on HADOOP-12977:
----------------------------------------
I like this patch, especially the FS spec improvements. +1 after following
minor comments are considered/addressed. Thanks.
{code:title=AbstractContractRootDirectoryTest.java}
88 assertEquals("/ not empty", 0, children.length);
89 if (children.length > 0) {
90 StringBuilder error = new StringBuilder();
91 error.append("Deletion of child entries failed, still have")
92 .append(children.length)
93 .append('\n');
94 for (FileStatus child : children) {
95 error.append(" ").append(child.getPath()).append('\n');
96 }
97 fail(error.toString());
98 }
{code}
If the children > 0 (non-empty), the assert in line 88 will simply throw
exception and the following code will be suppressed?
Another possible nit is that, when appending new line,
{{System.lineSeparator()}} is preferred to '\n'.
Is it possible to delete a path like "//"? I'm not sure about this.
> s3a ignores delete("/", true)
> -----------------------------
>
> Key: HADOOP-12977
> URL: https://issues.apache.org/jira/browse/HADOOP-12977
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Affects Versions: 2.9.0
> Reporter: Steve Loughran
> Assignee: Steve Loughran
> Priority: Minor
> Attachments: HADOOP-12977-001.patch, HADOOP-12977-002.patch,
> HADOOP-12977-branch-2-002.patch, HADOOP-12977-branch-2-002.patch
>
>
> if you try to delete the root directory on s3a, you get politely but firmly
> told you can't
> {code}
> 2016-03-30 12:01:44,924 INFO s3a.S3AFileSystem
> (S3AFileSystem.java:delete(638)) - s3a cannot delete the root directory
> {code}
> The semantics of {{rm -rf "/"}} are defined, they are "delete everything
> underneath, while preserving the root dir itself".
> # s3a needs to support this.
> # this skipped through the FS contract tests in
> {{AbstractContractRootDirectoryTest}}; the option of whether deleting / works
> or not should be made configurable.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]