【HBase十三】HBase知识点总结

1. 数据从MemStore flush到磁盘的触发条件有哪些?

   a.显式调用flush,比如flush 'mytable'

   b.MemStore中的数据容量超过flush的指定容量,hbase.hregion.memstore.flush.size,默认值是64M

2. Region的构成是怎么样?

1个Region由若干个Store组成,每个Store对应表的一个Column Family,这也是HBase列式存储的由来。

1个Store对应1个或者多个HFile,每次MemStore数据转磁盘都会创建一个新的HFile。

一个Store中的这些HFile可能有大有小,HBase有一个Compact的过程,将所有这些HFile整理成一个大的HFile文件,如果HFile文件的大小超过一定值,那么HBase将触发Region分裂动作

3. Region分裂的时机

当Region中的所有Store中有一个HFile的大小超过了HBase指定的值hbase.hregion.max.filesize,那么分裂就会发生

4.何谓HFile Compact?

The store files are monitored by a background thread to keep them under control. The flushes of memstores slowly build up an increasing number of on-disk files. If there are enough of them, the compaction process will combine them to a few, larger files

5.如何查看HBase Shell命令的联机帮助

hbase > help "命令"

如:

hbase > help "get"

hbase > help "put"

hbase > help "scan"

6.HBase修改操作

修改操作仍然使用put命令,不过需要以存在的RowKey作为主键

6.1插入数据:

hbase(main):021:0> put 'my_table', 'row1', 'cf_1:name', 'tom'

6.2 修改数据

hbase(main):021:0> put 'my_table', 'row1', 'cf_1:name', 'tom2'

6.3 获取数据(结果是tom2)

hbase(main):021:0> put 'my_table', 'row1', 'cf_1:name'

6.4 指定版本得到tom (其中1429186296076表示时间戳)

get 'my_table', 'row1', {COLUMN=>'cf_1:name',TIMESTAMP => 1429186296076}

7. 问题:

put一个数据row1(更新) -> flush -> put一个数据row1(更新)->get  为什么能够得到最新版本的,它是从最新的HFile开始扫描?指定版本也是按照HFile新旧进行扫描?

猜你喜欢

转载自bit1129.iteye.com/blog/2203003
今日推荐