You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Jeroen Hoek <je...@lable.org> on 2012/09/24 15:40:09 UTC

Recognising row creation and deletion in a co-processor

>From what I can tell, a fairly simple way to maintain a secondary
index table in HBase is to write a co-processor that acts on the
postDelete and postPut hooks of the table it is indexing for;
maintaining the index as rows get deleted and inserted.

For a Put it really doesn't matter if a row is new or just updated,
the indexer can simply do a Put itself; it doesn't matter if the row
was already indexed, it will just get updated. But what about Delete?

Is there a recommend way of detecting row deletion from the Delete
object supplied to the co-processor? Or is this approach the wrong way
entirely?

Kind regards,

Jeroen Hoek
Lable

RE: Recognising row creation and deletion in a co-processor

Posted by "Ramkrishna.S.Vasudevan" <ra...@huawei.com>.
For deletion I think we need to first delete on the main table, get the rowkeys that got deleted and apply them on the index table i.e form the deletes.

Here we may have to take care of different deletes like delete, deleteColumn and deleteColumnWithVersions.

Grouping of the deletes based on timestamp may be needed if delete or deleteColumn is specified.

Regards
Ram

> -----Original Message-----
> From: Jeroen Hoek [mailto:jeroen@lable.org]
> Sent: Monday, September 24, 2012 7:10 PM
> To: user@hbase.apache.org
> Subject: Recognising row creation and deletion in a co-processor
> 
> From what I can tell, a fairly simple way to maintain a secondary
> index table in HBase is to write a co-processor that acts on the
> postDelete and postPut hooks of the table it is indexing for;
> maintaining the index as rows get deleted and inserted.
> 
> For a Put it really doesn't matter if a row is new or just updated,
> the indexer can simply do a Put itself; it doesn't matter if the row
> was already indexed, it will just get updated. But what about Delete?
> 
> Is there a recommend way of detecting row deletion from the Delete
> object supplied to the co-processor? Or is this approach the wrong way
> entirely?
> 
> Kind regards,
> 
> Jeroen Hoek
> Lable