欢迎投稿

今日深度:

hbase表操作,hbase表

hbase表操作,hbase表


hbase shell

hbase shell> disable ‘oldTableName’
hbase shell> snapshot ‘oldTableName’, ‘tableSnapshot’
hbase shell> clone_snapshot ‘tableSnapshot’, ‘newTableName’
hbase shell> delete_snapshot ‘tableSnapshot’
hbase shell> drop ‘oldTableName’

java code

void renameTable(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);
}

www.htsjk.Com true http://www.htsjk.com/hbase/29712.html NewsArticle hbase表操作,hbase表 hbase shell hbase shell disable ‘oldTableName’ hbase shell snapshot ‘oldTableName’, ‘tableSnapshot’ hbase shell clone_snapshot ‘tableSnapshot’, ‘newTableName’ hbase shell delete_snapshot ‘tabl...
相关文章
    暂无相关文章
评论暂时关闭