[ 
https://issues.apache.org/jira/browse/HADOOP-13656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16833810#comment-16833810
 ] 

Steve Loughran commented on HADOOP-13656:
-----------------------------------------

h2. Production code

LGTM

h2. docs

bq. If the `-fs` option is passed, all files in the given filepath will be 
expunged and checkpoint is created.

I think I'd prefer just to say that this changes the filesystem:

{code}

If the `-fs` option is passed, the supplied filesystem will be expunged, rather 
than the default filesystem.

For example

```
hadoop fs -expunge --immediate -fs s3a://landsat-pds/
```

{code}

h2.TestTrash

> If the `-fs` option is passed, all files in the given filepath will be 
> expunged
>       and checkpoint is created.



h3. trashShell

Have this throw `Exception` and eliminate the logic related to swallowing 
exceptions.

If you do want to log things, use an SLF4J logger. This is probably a good time 
to move the existing
loggint in the test to SLF4J

wherever you assert on a value being equal to a constant, use assertEquals and 
add a message (L176)

And put the constant first (L193)

Take a look at S3GuardToolTestHelper.and it's exec() method, which is designed 
to execute the command, show
meaningful messages on a failure/invalid result, and save the output to a byte 
array for later assertions.

I know you've just extended the existing code in there, but looking at that 
code: it's not great, and even the most recent patch HADOOP-16410 could have 
been more rigorous. Even if you leave that existing code alone, let's do better 
now.

> fs -expunge to take a filesystem
> --------------------------------
>
>                 Key: HADOOP-13656
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13656
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs
>    Affects Versions: 2.7.3
>            Reporter: Steve Loughran
>            Assignee: Shweta
>            Priority: Minor
>         Attachments: HADOOP-13656.001.patch, HADOOP-13656.002.patch, 
> HADOOP-13656.003.patch, HADOOP-13656.004.patch, HADOOP-13656.005.patch
>
>
> you can't pass in a filesystem or object store to {{fs -expunge}; you have to 
> change the default fs
> {code}
> hadoop fs -expunge -D fs.defaultFS=s3a://bucket/
> {code}
> If the command took an optional filesystem argument, it'd be better at 
> cleaning up object stores. Given that even deleted object store data runs up 
> bills, this could be appreciated.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to