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 <[email protected]>
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
>

Reply via email to