首页 > 数据库 > mysql教程 > HBase "Raw" scans

HBase "Raw" scans

WBOY
发布: 2016-06-07 16:26:19
原创
1738 人浏览过

In HBase Scans (and by extension Gets) do not retrieve deleted cells or the tombstone markers that mark them as deleted. Sometimes is useful for trouble shooting (or backup - there will be a separate blog post about that soon) to see all c

In HBase Scans (and by extension Gets) do not retrieve deleted cells or the tombstone markers that mark them as deleted.
Sometimes is useful for trouble shooting (or backup - there will be a separate blog post about that soon) to see all cells including deleted cells and the tombstone markers.

HBASE-4536 introduces "raw" Scans (only available in HBase trunk - not the upcoming 0.92). In the Java client these are enabled by Scan.setRaw(true).

The HBase shell also supports this by adding RAW=>true to a scan.

Once raw mode is enabled the returned result contains not only the standard KeyValues, but also KeyValues for deleted cells and for tombstone markers (which are just special types of KeyValues, more on delete markers can be found here).

Here's an example of what it would look like in the shell:

hbase(main):001:0> scan 'x2', {RAW=>true, VERSIONS=>10}ROW                   COLUMN+CELL                                                r1                   column=f:c, timestamp=1323323611106, value=v3              r1                   column=f:c, timestamp=1323323609988, type=DeleteColumn     r1                   column=f:c, timestamp=1323323609988, value=v2              r1                   column=f:c, timestamp=1323323608554, value=v1              r2                   column=f:c, timestamp=1323323617759, value=v3              r2                   column=f:c, timestamp=1323323616226, value=v2              r2                   column=f:c, timestamp=1323323614496, value=v1             2 row(s) in 0.6380 seconds
登录后复制

In this the above example values 'v2' and 'v1' for row key 'r1' have been deleted with a column delete marker.

hbase(main):005:0> scan 'x1', {RAW=>true, VERSIONS=>10}ROW                   COLUMN+CELL                                                r2                   column=f:, timestamp=1323323616226, type=DeleteFamily      r2                   column=f:c, timestamp=1323323617759, value=v3              r2                   column=f:c, timestamp=1323323616226, value=v2              r2                   column=f:c, timestamp=1323323614496, value=v1             2 row(s) in 0.0500 seconds
登录后复制

Here 'v2' and 'v1' of row key 'r2' have been deleted with family delete marker.

Notice how the column marker is sorted in line with the cells it affects (it sorted after the cell for value 'v3'), but that the family marker is sorted before all cell of the affected row key.

The sort order was carefully designed to allow HBase to identify all cells affected by a delete marker in single forward scan through the store files(s).

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板