hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anoop John <anoop.hb...@gmail.com>
Subject Re: Co-processors: Know if row is being deleted by TTL
Date Thu, 31 Aug 2017 04:57:47 GMT
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 <yuzhihong@gmail.com> 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 <
> cheyenne.osanu.forbes@gmail.com> 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 <yuzhihong@gmail.com> 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 <
>> > cheyenne.osanu.forbes@gmail.com> Date: 8/28/17  2:51 PM  (GMT-08:00) To:
>> > user@hbase.apache.org 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
>> >
>>

Mime
View raw message