当前位置: 首页 > 工具软件 > Versions > 使用案例 >

HBase的VERSIONS的意思

麹承
2023-12-01
  1. 每个不同时间戳的cell就是一个版本,时间戳就是版本

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

    每次flush,最多flush VERSIONS个版本的数据!

查看表的列族的版本号

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

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

修改列族的版本号数量

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

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

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

 类似资料: