设为首页 加入收藏

TOP

hbase 修改表名 Java api(shell)
2019-02-12 01:46:22 】 浏览:67
Tags:hbase 修改 Java api shell

hbase shell:
01.hbase shell> disable 'tableName'
02.hbase shell> snapshot 'tableName', 'tableSnapshot'
03.hbase shell> clone_snapshot 'tableSnapshot', 'newTableName'
04.hbase shell> delete_snapshot 'tableSnapshot'
05.hbase shell> drop 'tableName'
06.

java code:
01.void rename(HBaseAdmin admin, String oldTableName, String newTableName) {
02.

String snapshotName = randomName();
03.admin.disableTable(oldTableName);
04.admin.snapshot(snapshotName, oldTableName);
05.admin.cloneSnapshot(snapshotName, newTableName);
06.admin.deleteSnapshot(snapshotName);
07.admin.deleteTable(oldTableName);
08.}

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇GeoMesa-HBase部署实践 下一篇HBase的物理模型

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目