[
https://issues.apache.org/jira/browse/HADOOP-14759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16417045#comment-16417045
]
Gabor Bota edited comment on HADOOP-14759 at 3/28/18 8:45 AM:
--------------------------------------------------------------
Thanks for the review [~mackrorysd]!
I think we should handle this case otherwise, like throwing an error if no
prefix specified at all. A prefix (default "/" prefix as well) should be
specified to run this command, so if no prefix specified, it should fail fast
and print usage.
The other way would be to use something like this:
{code:java}
String keyPrefix = "/";
if(paths.get(0).length() == 0) {
Path path = new Path(paths.get(0));
keyPrefix = PathMetadataDynamoDBTranslation.pathToParentKey(path);
}
getStore().prune(divide, keyPrefix);
{code}
was (Author: gabor.bota):
Thanks for the review [~mackrorysd]!
I think we should handle this case otherwise, like throwing an error if no
prefix specified at all. A prefix (default "/" prefix as well) should be
specified to run this command.
The other way would be to use something like this:
{code:java}
String keyPrefix = "/";
if(paths.get(0).length() == 0) {
Path path = new Path(paths.get(0));
keyPrefix = PathMetadataDynamoDBTranslation.pathToParentKey(path);
}
getStore().prune(divide, keyPrefix);
{code}
> S3GuardTool prune to prune specific bucket entries
> --------------------------------------------------
>
> Key: HADOOP-14759
> URL: https://issues.apache.org/jira/browse/HADOOP-14759
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/s3
> Affects Versions: 3.0.0-beta1
> Reporter: Steve Loughran
> Assignee: Gabor Bota
> Priority: Minor
> Attachments: HADOOP-14759.001.patch, HADOOP-14759.002.patch,
> HADOOP-14759.003.patch, HADOOP-14759.004.patch
>
>
> Users may think that when you provide a URI to a bucket, you are pruning all
> entries in the table *for that bucket*. In fact you are purging all entries
> across all buckets in the table:
> {code}
> hadoop s3guard prune -days 7 s3a://ireland-1
> {code}
> It should be restricted to that bucket, unless you specify otherwise
> +maybe also add a hard date rather than a relative one
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]