`
bupt04406
  • 浏览: 347420 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

hbase的一些语义

 
阅读更多

hbase里面对一行操作前会加锁。

http://hadoop-hbase.blogspot.com/2012/01/hbase-intra-row-transactions.html

https://issues.apache.org/jira/browse/HBASE-3584

HBASE-3584的功能是对同一行的Put和Delete可以原子性的完成。

 

 

Delete: 

put 't1', 'r1', 'f1:c', 'aaa', 1

put 't1', 'r1', 'f1:c', 'bbb', 2

put 't1', 'r1', 'f1:c', 'ccc', 3

delete 't1','r1','f1:c', 3 这个会把前面3条数据都删除掉。

scan 't1'

scan 't1', {RAW => true, VERSIONS => 10}

Deletes work by creating tombstone markers. For example, let's suppose we want to delete a row. For this you can specify a version, or else by default the currentTimeMillis is used. What this means is “delete all cells where the version is less than or equal to this version”.

 

Memstore flush的时候,应该删除的put会被过滤掉,不写入HFile。Delete marker在major compact的时候删除。

https://issues.apache.org/jira/browse/HBASE-4536 

https://issues.apache.org/jira/browse/HBASE-4071

https://issues.apache.org/jira/browse/HBASE-4241

 

region太大的问题是大compact的时候会影响正常读写。

 

Region做compact的时候是一个个cf来做的。

 

 

 https://wiki.trafodion.org/wiki/index.php/Main_Page

 

The main practical difference is that only a major compaction cleans out delete markers.
Delete markers cannot be removed during a minor compaction since an affected KeyValue could exist in an HFile that is not part of this compaction.

 

Delete只在major_compact的时候删除掉

Memstore flush的时候会去除无用的数据

minor compaction的时候也会删除无用的数据

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics