HBASE-8574 Add how to rename a table in th docbook (addendum)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1485515 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
mbertozzi 2013-05-22 23:59:17 +00:00
parent f51c141a3a
commit 3f995da2b1
1 changed files with 4 additions and 2 deletions

View File

@ -904,14 +904,16 @@ do it using the hbase shell:
<programlisting>hbase shell> disable 'tableName'
hbase shell> snapshot 'tableName', 'tableSnapshot'
hbase shell> clone 'tableSnapshot', 'newTableName'
hbase shell> delete_snapshot 'tableSnapshot'</programlisting>
hbase shell> delete_snapshot 'tableSnapshot'
hbase shell> drop 'tableName'</programlisting>
or in code it would be as follows:
<programlisting>void rename(HBaseAdmin admin, String oldTableName, String newTableName) {
String snapshotName = randomName();
admin.disableTable(oldTableName);
admin.snapshot(snapshotName, oldTableName);
admin.cloneSnapshot(snapshotName, newTableName);
admin.deleteSnapshot(snapshotName);
admin.deleteTable(oldTableName)
admin.deleteTable(oldTableName);
}</programlisting>
</para>
</section>