Hbase 表未显示任何版本控制

Soh*_*ohi 0 hbase

我正在使用 Cloudera Quick Start VM 并在其上运行 hbase。以下是我的疑问:

hbase(main):009:0> create 'test', 'cf'
0 row(s) in 0.4500 seconds

=> Hbase::Table - test
hbase(main):010:0> put 'test', 'row3', 'cf:c', 'value3'
0 row(s) in 0.1950 seconds

hbase(main):011:0> put 'test', 'row3', 'cf:c', 'value4'
0 row(s) in 0.0580 seconds

hbase(main):012:0> scan 'test' 
ROW                                      COLUMN+CELL                                                                                                         
 row3                                    column=cf:c, timestamp=1414148485533, value=value4                                                                  
1 row(s) in 0.0420 seconds

hbase(main):013:0> scan 'test', {VERSIONS => 3}
ROW                                      COLUMN+CELL                                                                                                         
 row3                                    column=cf:c, timestamp=1414148485533, value=value4                                                                  
1 row(s) in 0.0370 seconds

hbase(main):014:0> get 'test', 'row3', {COLUMN => 'cf:c', VERSIONS => 3}
COLUMN                                   CELL                                                                                                                
 cf:c                                    timestamp=1414148485533, value=value4                                                                               
1 row(s) in 0.0230 seconds
Run Code Online (Sandbox Code Playgroud)

它应该显示 row3 的两个版本,但后面的值会覆盖前面的值。我不知道为什么版本没有出现。

Man*_*ath 5

创建 HBase 表时,指定要存储的版本数。

对于你的情况,你可以这样做:

create 'test', {NAME => 'cf', VERSIONS => 3}