You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Jeyendran Balakrishnan <jb...@docomolabs-usa.com> on 2009/09/16 21:48:53 UTC

RowLock question

What does 
RowLock HTable.lockRow(byte[] row)
do when the row does not exist in the table?
- return null?
- throw an exception - generic IOException, or some subclass, or
IOException wrapping another cause ...?
- ??

Thanks,
jp


RE: RowLock question

Posted by Jeyendran Balakrishnan <jb...@docomolabs-usa.com>.
Thanks a lot, Ryan!

Cheers,
jp


-----Original Message-----
From: Ryan Rawson [mailto:ryanobjc@gmail.com] 
Sent: Wednesday, September 16, 2009 1:27 PM
To: hbase-user@hadoop.apache.org
Subject: Re: RowLock question

Due to the in memory locking system, you can take a row lock out on a
row
that doesn't exist yet. This would allow you to lock a row, do an
initial
set of mutations then release it.

I would caution against people using the explicit lock system. Waiting
for a
lock costs scarce system resources, thus you can self-dos yourself if
too
many clients wait for a row lock.

Consider using increment column value or the CAS methods and optimistic
locking to avoid long lived explicit locks.

On Sep 16, 2009 12:49 PM, "Jeyendran Balakrishnan" <
jbalakrishnan@docomolabs-usa.com> wrote:

What does
RowLock HTable.lockRow(byte[] row)
do when the row does not exist in the table?
- return null?
- throw an exception - generic IOException, or some subclass, or
IOException wrapping another cause ...?
- ??

Thanks,
jp

Re: RowLock question

Posted by Ryan Rawson <ry...@gmail.com>.
Due to the in memory locking system, you can take a row lock out on a row
that doesn't exist yet. This would allow you to lock a row, do an initial
set of mutations then release it.

I would caution against people using the explicit lock system. Waiting for a
lock costs scarce system resources, thus you can self-dos yourself if too
many clients wait for a row lock.

Consider using increment column value or the CAS methods and optimistic
locking to avoid long lived explicit locks.

On Sep 16, 2009 12:49 PM, "Jeyendran Balakrishnan" <
jbalakrishnan@docomolabs-usa.com> wrote:

What does
RowLock HTable.lockRow(byte[] row)
do when the row does not exist in the table?
- return null?
- throw an exception - generic IOException, or some subclass, or
IOException wrapping another cause ...?
- ??

Thanks,
jp