Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st. We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here. Need help or have questions? Drop us a line at [email protected]
The number of cells returned to the client are
normally filtered based on the table configuration; however, when using the RAW
=> true parameter, you can retrieve all of the versions kept by HBase, unless
there was a major compaction or a flush to disk event in meanwhile.
Demonstration
Create a table with a single column family:
create 't1', 'f1'
Configure it to retain a maximum version count of 3:
alter 't1',NAME=>'f1',VERSIONS=>3
Perform 4 puts:
put 't1','r1','f1:c1',1
put 't1','r1','f1:c1',2
put 't1','r1','f1:c1',3
put 't1','r1','f1:c1',4
Scan with RAW=>true. I used VERSIONS as 100 for a catch-all. It could have been anything greater than 3 (number of versions set previously). Unless specified, only the latest version is returned by scan command.
When deciding the number of versions to retain,
it is best to treat that number as the minimum version count available at a
given time and not as a given constant. Until a flush to disk and a major
compaction, number of versions available is higher than the configured for the
table.