On 12/13/10 11:11 AM, Adam Phelps wrote:
Does anyone have suggestions regarding the best way to modify existing
entries in a table?

We have our tables set up such that when we create an entry we set its
timestamp such that the entry has a rough expiration time, ie we have a
TTL on the table as a whole and then adjust the time stamp so that HBase
will clean up the entry approximately when we wish.

However there are some rare situations where we would like to change
that expiration time on a subset of the entries (typically either to
have them expire immediately or to extend their life).

My current thought is to use TableMapReduceUtil to run a MR job against
a table, filter out just the keys I need to change, create copies of the
KeyValue's for that key with a new timestamp, and write them back out
using the existing keys. Would something along these lines work?

Alternately is there some better way to do this that I haven't seen yet?

I tried implementing this, and it seems to only mostly work. This method appears to allow a timestamp to be increased but not decreased.

I'm guessing that HBase is trying to prevent "older" entries from accidentally overwriting "newer" ones. Does anyone know if there's a way to overcome this? Or suggestions on other ways to have entry-specific TTLs?

- Adam

Reply via email to