You cannot rely on postDelete for cells removed because of TTL.. Because it is not a user started delete op and there wont be any postDelete happening for this cell.. The cell is there in some HFile. Even after the TTL time elapsed also.. When a read happens, the read flow will filter out such cells from reaching client.. Also if there been a compaction happened involving this file, the cell would have got removed. So you can not really guarantee.
-Anoop- On Wed, Aug 30, 2017 at 3:15 AM, Ted Yu <[email protected]> wrote: > I wonder if you can make use of per Cell TTL ? > > See third paragraph under http://hbase.apache.org/book.html#ttl > > Basically there would be two flags (same row): one for marking whether user > has submitted the comment, the other is for the TTL you described. > When postDelete() is called on the TTL'ed cell, you can retrieve the first > flag and make decision. > > FYI > > On Mon, Aug 28, 2017 at 10:31 PM, Cheyenne Forbes < > [email protected]> wrote: > >> I'm sorry, "*postDelete*" wasnt supposed to be a link, I copied the text >> and gmail sent it as a link. >> >> *Use case:* >> >> When a user is commenting with a photo it is uploaded to be able to be >> previewed and the id of the photo is added to a hbase table "tempFiles" >> with a 5 hour TTL for each row, if the user submits the comment, the row is >> deleted manually and *postDelete* would "ignore" it but if it isnt >> submitted and the TTL reaches, *postDelete* would run a piece of code which >> would delete the file from my file server >> >> >> On Mon, Aug 28, 2017 at 5:33 PM, Ted Yu <[email protected]> wrote: >> >> > There is no such indication from the book you mentioned. >> > Can you tell us your use case where such distinction is needed ? >> > -------- Original message --------From: Cheyenne Forbes < >> > [email protected]> Date: 8/28/17 2:51 PM (GMT-08:00) To: >> > [email protected] Subject: Co-processors: Know if row is being >> > deleted by TTL >> > Is is possible to know if a row is being deleted manually or by the >> > reaching of the TTL on "*postDelete >> > <https://hbase.apache.org/0.94/apidocs/org/apache/hadoop/ >> > hbase/coprocessor/BaseRegionObserver.html#postDelete(org.apache.hadoop. >> > hbase.coprocessor.ObserverContext,%20org.apache. >> > hadoop.hbase.client.Delete,%20org.apache.hadoop.hbase. >> > regionserver.wal.WALEdit,%20boolean)>* >> > "? >> > >> > Regards, >> > >> > Cheyenne O. Forbes >> > >>
