You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "stack (JIRA)" <ji...@apache.org> on 2013/05/17 23:31:16 UTC

[jira] [Resolved] (HBASE-8574) Add how to rename a table in the docbook

     [ https://issues.apache.org/jira/browse/HBASE-8574?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack resolved HBASE-8574.
--------------------------

    Resolution: Fixed

I added this to the ops section.  Let me push it and other recent refguide edits out.
                
> Add how to rename a table in the docbook 
> -----------------------------------------
>
>                 Key: HBASE-8574
>                 URL: https://issues.apache.org/jira/browse/HBASE-8574
>             Project: HBase
>          Issue Type: Task
>          Components: documentation
>    Affects Versions: 0.94.7, 0.95.0
>            Reporter: Matteo Bertozzi
>            Assignee: Matteo Bertozzi
>             Fix For: 0.98.0, 0.94.8, 0.95.1
>
>
> Add a section "how to rename a table" in the doc book.
> The current easy solution without adding extra code in 94/95 is to use snapshots
> {code}
> hbase shell> disable 'tableName'
> hbase shell> snapshot 'tableName', 'tableSnapshot'
> hbase shell> clone 'tableSnapshot', 'newTableName'
> hbase shell> delete_snapshot 'tableSnapshot'
> {code}
> {code}
> void rename(HBaseAdmin admin, String oldTableName, String newTableName) {
>     String snapshotName = randomName();
>     admin.snapshot(snapshotName, oldTableName);
>     admin.cloneSnapshot(snapshotName, newTableName);
>     admin.deleteSnapshot(snapshotName);
>     admin.deleteTable(oldTableName)
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira