hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OpenInx <open...@gmail.com>
Subject Re: Atomic read-modify-write: constructing an interesting TimeRange for CheckAndMutateBuilder.timeRange
Date Tue, 06 Aug 2019 03:41:17 GMT
Hi
I've checked the code, I think you can use the deprecated TimeRange(ts+1)
first,  also the methods defined in TimeRange
is not good enough now, we may need to create an issue to address this
thing.

Thanks.

On Tue, Aug 6, 2019 at 10:15 AM Wilson, Huon (Data61, Eveleigh) <
Huon.Wilson@data61.csiro.au> wrote:

> Hi,
>
> I’m trying to do an atomic read-modify-write where a cell is read and then
> rewritten with an updated value (updated in a complicated way, more than
> just incrementing), but only if there’s been no writes since it was read,
> otherwise try again from the read.
>
> My plan is to use something like
>
>     table.checkAndMutate(row, family).qualifier(qualifier).timeRange(new
> TimeRange(ts + 1)).ifNotExists().put(put)
>
> to insert if the cell row/family/qualifier doesn't exist in the range `[ts
> + 1, infinity)`, which I think means no writes after time `ts`. However,
> that TimeRange constructor is @Deprecated and @Private, and the only
> remaining ways to publicly construct a TimeRange is  `TimeRange.allTime()`
> ([0, infinity)) and `TimeRange.at(long ts)` ([ts, ts + 1)), neither of
> which are right.
>
> Is there a way to create this time range, or another way to achieve this
> RMW operation?
>
> An alternative is to do a value comparison with `.ifEquals(...)` but my
> values could be quite large (kilobytes), so I was thinking this range
> comparison would be better.
>
> ---
> Huon Wilson
> CSIRO | Data61
> https://www.data61.csiro.au
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message