hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: PreBatchMutate - Delete another row inside this method
Date Mon, 24 Nov 2014 22:32:04 GMT
Row '123' may be in a different region from the one row '111' is in. 
Cross region RPC should be avoided in coprocessor. 

Does your application require that the deletion of row '123' be in the same transaction as
the mutation ?

Cheers

On Nov 24, 2014, at 12:31 PM, tvraju <tvvraju@gmail.com> wrote:

> Hi,
> IN PreBatchMutate method in Observer, I am trying to check whether a row ,
> say '123', exists and delete the row.  This row is different from the
> current row , say '111' ,in the method, which has locked the current row.
> But Delete operation is waiting for the lock to '111' instead of '123'.
> 
> Say,  I have a table - test_delete, cf:delete_row
> I have two rows 1) '123','defaultRow' 2) '111','111'
> 
> I will try to re-insert the second row with '111','123'. IN PreBatchMutate
> method, I am trying to check if row '123' exists and delete it.
> 
> Result result = c.getEnvironment().getRegion().get(new
> Get(Bytes.toBytes('123')));
>                                byte[] deleteRow = result.getRow();
>                                logger.debug(String.format("Deleting row
> :%s", Bytes.toString(deleteRow)));
>                                Delete delete = new Delete(deleteRow);
> 
> c.getEnvironment().getRegion().delete(delete);
> 
> Exception :
> 
> org.apache.hadoop.hbase.regionserver.HRegion: Failed getting lock in batch
> put, row=111
> java.io.IOException: Timed out waiting for lock for row: 111
> 
> Please advice.
> 
> 
> 
> 
> 
> --
> View this message in context: http://apache-hbase.679495.n3.nabble.com/PreBatchMutate-Delete-another-row-inside-this-method-tp4066298.html
> Sent from the HBase User mailing list archive at Nabble.com.

Mime
View raw message