[
https://issues.apache.org/jira/browse/HBASE-8572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14196105#comment-14196105
]
Ashish Singhi commented on HBASE-8572:
--------------------------------------
Checked following things with the patch,
1. Usage
{noformat}
hbase(main):004:0> delete_snapshot
ERROR: wrong number of arguments (0 for 1)
Here is some help for this command:
Delete all of snapshots matching the given regex. Examples:
hbase> delete_snapshot 'snapshotName'
hbase> delete_snapshot 's.*'
{noformat}
2. list_snapshots
{noformat}
hbase(main):006:0> list_snapshots
SNAPSHOT TABLE + CREATION TIME
j t (Tue Nov 04 18:29:14
+0530 2014)
k t (Tue Nov 04 18:29:02
+0530 2014)
k1 t (Tue Nov 04 18:29:06
+0530 2014)
3 row(s) in 0.0620 seconds
=> ["j", "k", "k1"]
{noformat}
3. delete_snapshot 'k.*' with 'n'
{noformat}
hbase(main):007:0> delete_snapshot 'k.*'
k
k1
Delete the above 2 snapshots (y/n)?
n
hbase(main):008:0> list_snapshots
SNAPSHOT TABLE + CREATION TIME
j t (Tue Nov 04 18:29:14
+0530 2014)
k t (Tue Nov 04 18:29:02
+0530 2014)
k1 t (Tue Nov 04 18:29:06
+0530 2014)
3 row(s) in 0.0330 seconds
=> ["j", "k", "k1"]
{noformat}
4. delete_snapshot 'k.*' with 'y'
{noformat}
hbase(main):009:0> delete_snapshot 'k.*'
k
k1
Delete the above 2 snapshots (y/n)?
y
0 row(s) in 0.0970 seconds
hbase(main):010:0> list_snapshots
SNAPSHOT TABLE + CREATION TIME
j t (Tue Nov 04 18:29:14
+0530 2014)
1 row(s) in 0.0180 seconds
=> ["j"]
{noformat}
5. delete_snapshot 'j'
{noformat}
hbase(main):011:0> delete_snapshot 'j'
j
Delete the above 1 snapshots (y/n)?
y
0 row(s) in 0.0360 seconds
hbase(main):012:0> list_snapshots
SNAPSHOT TABLE + CREATION TIME
0 row(s) in 0.0060 seconds
=> []
{noformat}
If anything else needs to be checked, Please let me know.
> Enhance delete_snapshot.rb to call snapshot deletion API with regex
> -------------------------------------------------------------------
>
> Key: HBASE-8572
> URL: https://issues.apache.org/jira/browse/HBASE-8572
> Project: HBase
> Issue Type: Improvement
> Reporter: Ted Yu
> Assignee: Ashish Singhi
> Attachments: HBASE-8572.patch
>
>
> HBASE-8461 added the API to HBaseAdmin which allows user to specify regular
> expression for deleting snapshots.
> This JIRA would allow delete_snapshot.rb to utilize this functionality.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)