1. 每个不同时间戳的cell就是一个版本,时间戳就是版本
  2. 可以设置列族的VERSIONS属性,当执行flush操作时,put的记录
    会根据时间戳选择最新的VERSIONS个版本的数据flush到磁盘中!
    每次flush,最多flush VERSIONS个版本的数据!

查看表的列族的版本号

下面VERSIONS都是一个,意思是cf1和cf2和f3列族都是保留一个版本.

  1. hbase(main):002:0> describe 'ns1:t1'
  2. Table ns1:t1 is ENABLED
  3. ns1:t1
  4. COLUMN FAMILIES DESCRIPTION
  5. {NAME => 'cf1', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_B
  6. LOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCK
  7. SIZE => '65536', REPLICATION_SCOPE => '0'}
  8. {NAME => 'cf2', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_B
  9. LOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCK
  10. SIZE => '65536', REPLICATION_SCOPE => '0'}
  11. {NAME => 'f3', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BL
  12. OCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKS
  13. IZE => '65536', REPLICATION_SCOPE => '0'}
  14. 3 row(s) in 4.3230 seconds

修改列族的版本号数量

修改 ns1:t1表的 cf1列族版本号为3

alter ‘ns1:t1’ ,{NAME =>’cf1’,VERSIONS =>’3’}

  1. hbase(main):004:0> alter 'ns1:t1' ,{NAME =>'cf1',VERSIONS =>'3'}
  2. Updating all regions with the new schema...
  3. 0/1 regions updated.
  4. 1/1 regions updated.
  5. Done.
  6. 0 row(s) in 3.8090 seconds