3

According with HBase specs :

"ColumnFamilies can set a TTL length in seconds, and HBase will automatically delete rows once the expiration time is reached. This applies to all versions of a row - even the current one. The TTL time encoded in the HBase for the row is specified in UTC."

Specifically what I'm not understanding is this sentence "Once the expiration time is reached"...of what? All versions of all cells? at least one version of one cell?

Suppose I have a table which has a column family with TTL set to X.

  • I'm inserting a cell with timestamp 1: what is the expiry date of this row? 1 + X?
  • Next, I'm inserting another cell (using the same row key) with timestamp 2: what is the expiry date of the entire row? Still 1 + X or 2 + X?
mrsrinivas
  • 34,112
  • 13
  • 125
  • 125
Andrea
  • 2,714
  • 3
  • 27
  • 38

1 Answers1

11

That appears to be a typo in the HBase reference guide. It should say "cell", not "row"; a row has no built-in timestamp other than the timestamp of its cells.

Ian Varley
  • 9,227
  • 5
  • 29
  • 34
  • 1
    Also, you should open a JIRA for this, or supply a doc patch if you feel so inclined: https://issues.apache.org/jira/browse/HBASE – Ian Varley Sep 02 '12 at 14:07
  • Thank you for your response. So that means, assuming I have a row with two cells (each one has a different timestamp), the row will be "deleted" gradually (First the oldest cell, then in a second momemnt the youngest one)? – Andrea Sep 03 '12 at 13:29
  • 2
    @Andrea I personally tested it by setting the TTL to 60 seconds and insert 6 values into one cell every 10 seconds, and found they were deleted gradually -- deleted one by one every 10 seconds. – Jing He Aug 23 '17 at 09:55