When we create any HBase table, does timestamp appear in that table when we scan it?
For example:
create 'test', 'cf'
put 'test', 'row1', 'cf:a', 'value1'
put 'test', 'row2', 'cf:b', 'value2'
put 'test', 'row3', 'cf:c', 'value3'
scan 'test'
ROW COLUMN+CELL
row1 column=cf:a, timestamp=1288380727188, value=value1
row2 column=cf:b, timestamp=1288380738440, value=value2
row3 column=cf:c, timestamp=1288380747365, value=value3
Timestamps are actually mandatory part of HBase columns and their main purpose is column versioning. Here is some more detailed explanation about versions and timestamps. Also " HBase definitive guide " book contains detailed PUT operation description which discovers almost everything you can do with timestamps (TS).
The hints here are:
So yes, you cannot get rid of these timestamps / versions but there is lot of options how to use them.
Yes, everytime you make a PUT
on a table you set the timestamp. By default this is the currentTimeInMillis
but you can set your own timestamp as well.
The timestamp
allows for versioning of the cells. A scan
will return the latest version, but you can specify the maximum versioning using Scan.setMaxVersions()
or if you want a specific timestamp you can use Scan.setTimeRange()
or Scan.setTimeStamp()
Yes it appear. You can see in your example
row1 column=cf:a, timestamp=1288380727188 , value=value1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.