hbase shell 预分区
来源:互联网 发布:淘宝如何登录店铺 编辑:程序博客网 时间:2024/06/05 00:55
使用HBase Shell建表的时候,除了一些常用的option以外,我们还可以同时建立一些预分区,这样可以预防初次插入数据时热点问题。
通过直接输入create,我们可以看到有如下提示:
1
2
3
4
5
6
7
8
9
10
11
12
Examples:
hbase> create
't1'
, {NAME =>
'f1'
, VERSIONS => 5}
hbase> create
't1'
, {NAME =>
'f1'
}, {NAME =>
'f2'
}, {NAME =>
'f3'
}
hbase>
# The above in shorthand would be the following:
hbase> create
't1'
,
'f1'
,
'f2'
,
'f3'
hbase> create
't1'
, {NAME =>
'f1'
, VERSIONS => 1, TTL => 2592000, BLOCKCACHE =>
true
}
hbase> create
't1'
,
'f1'
, {SPLITS => [
'10'
,
'20'
,
'30'
,
'40'
]}
hbase> create
't1'
,
'f1'
, {SPLITS_FILE =>
'splits.txt'
}
hbase>
# Optionally pre-split the table into NUMREGIONS, using
hbase>
# SPLITALGO ("HexStringSplit", "UniformSplit" or classname)
hbase> create
't1'
,
'f1'
, {NUMREGIONS => 15, SPLITALGO =>
'HexStringSplit'
}
例子中仅给出了要么有普通option,要么是有指定分区等选项,但是没有给出既有普通option(例如VERSIONS,COMPRESSION等),又创建预分区的例子。
如果有这个需求呢?如下对吗?
create 't', {NAME => 'f', VERSIONS => 1, COMPRESSION => 'SNAPPY', SPLITS => ['10','20','30']}
运行后发现肯定是不行的。正确的写法应该是这样的:
1
2
create
't'
, {NAME =>
'f'
, VERSIONS => 1, COMPRESSION =>
'SNAPPY'
},
{SPLITS => [
'10'
,
'20'
,
'30'
]}
因为分区时针对全表而非某个Column Family的。
0 0
- hbase shell 预分区
- Hbase预分区
- HBase表预分区
- HBase表预分区
- hbase的预分区
- shell和javaAPI两种方式创建hbase表并预分区
- HBase预分区のUniformSplit
- Hbase预分区种子生成
- HBase 创建表预分区
- HBase表备份&预分区
- hbase建表时,指定预分区
- hbase shell之创建表的同时创建分区
- HBase学习之六: hbase的预分区设计
- HBase学习之六: hbase的预分区设计
- hbase建表时region预分区的方法
- HBase预分区解决写热点问题。
- HBase预分区region自定义算法
- hbase 预分区官网例子
- TCP编程
- 软件与经济学 (开发篇)
- 黑马程序员_集合
- xStream完美转换XML、JSON /XStream Xml与JavaBean对象的互转经典【转载】
- leetcode题目解答---- SortList
- hbase shell 预分区
- 颜色对照表
- 统计输入的行数、单词数与字符数用C实现
- 用Pelican和Github Pages在Linux上搭建个人博客
- DB2 Session每周讨论话题
- 关于android:layout_weight
- WGS84、GCJ-02(火星坐标)、百度坐标,Web墨卡托坐标
- 浅谈C中的malloc和free
- java常见错误整理