hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mingtao Zhang <mail2ming...@gmail.com>
Subject Re: Consistency Model
Date Fri, 25 Jul 2014 18:31:26 GMT
Like looping until it's success?

Mingtao Sent from iPhone

> On Jul 25, 2014, at 2:21 PM, Stack <stack@duboce.net> wrote:
> 
> Will the CAS methods work for you?
> 
> e.g.
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/HTableInterface.html#checkAndPut(byte[],
> byte[], byte[], byte[], org.apache.hadoop.hbase.client.Put)
> 
> St.Ack
> 
> 
> On Fri, Jul 25, 2014 at 10:49 AM, Mingtao Zhang <mail2mingtao@gmail.com>
> wrote:
> 
>> Hi,
>> 
>> I have the following row key and value (column family/column qualifier
>> ignored):
>> 
>> hash(sitename) + sessionid
>>  value: duration
>> 
>> I need to calculate the duration in a distributed environment correctly. As
>> far as I know, I need to lock the specific row during read-write (in my
>> case my read is only happen before the write) to ensure consistency.
>> 
>> Previously from the HBase Definitive Guide or 0.94.15, I could see (though
>> deprecated)
>> 
>> RowLock lockRow(byte[] row) throws IOException;
>> void unlockRow(RowLock rl) throws IOException;
>> 
>> But it's seems gone with the latest API.
>> 
>> 
>> https://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/HTableInterface.html
>> 
>> Is there anyway I could achieve the consistency with latest HBase?
>> 
>> Best Regards,
>> Mingtao
>> 

Mime
View raw message