You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Wei Tan <wt...@us.ibm.com> on 2012/10/09 22:35:29 UTC

connect to the region from coprocessor

Hi,

In my preput coprocessor I would like to get the old value of the row been 
input. Now I am creating a HTable instance and using the get interface; 
function wise it works fine. Given the row is physically in the same 
region as the cp, is there any lightweight approach doing that?

Thanks! 


Best Regards,
Wei

RE: connect to the region from coprocessor

Posted by "Ramkrishna.S.Vasudevan" <ra...@huawei.com>.
Here oldValue anyway will have the same rowkey right.  So it should be in the same region but as older version.

Regards
Ram

> -----Original Message-----
> From: Jean-Marc Spaggiari [mailto:jean-marc@spaggiari.org]
> Sent: Wednesday, October 10, 2012 5:24 PM
> To: user@hbase.apache.org
> Subject: Re: connect to the region from coprocessor
> 
> But is it possible that the previous value for this row to be stored
> in another region?
> 
> I mean, if cells are big, they might be on different regions /
> regionservers?
> 
> 2012/10/10, Anoop Sam John <an...@huawei.com>:
> > Hi
> >     To your prePut() method you are getting an ObserverContext
> argument.
> > From this you can easily get a ref to the current region.
> > ctx.getEnvironment().getRegion()
> > Directly make calls to this region object. Creation of the HTable
> instance
> > and making a get() will be too much unwanted overhead.
> >
> > -Anoop-
> > ________________________________________
> > From: Wei Tan [wtan@us.ibm.com]
> > Sent: Wednesday, October 10, 2012 2:05 AM
> > To: hbase-user@hadoop.apache.org
> > Subject: connect to the region from coprocessor
> >
> > Hi,
> >
> > In my preput coprocessor I would like to get the old value of the row
> been
> > input. Now I am creating a HTable instance and using the get
> interface;
> > function wise it works fine. Given the row is physically in the same
> > region as the cp, is there any lightweight approach doing that?
> >
> > Thanks!
> >
> >
> > Best Regards,
> > Wei


RE: connect to the region from coprocessor

Posted by Anoop Sam John <an...@huawei.com>.
>I mean, if cells are big, they might be on different regions / regionservers?
All the KVs [columns, versions] corresponding to one rowkey will be always there in one region. One row is not splittable

-Anoop-
________________________________________
From: Jean-Marc Spaggiari [jean-marc@spaggiari.org]
Sent: Wednesday, October 10, 2012 5:24 PM
To: user@hbase.apache.org
Subject: Re: connect to the region from coprocessor

But is it possible that the previous value for this row to be stored
in another region?

I mean, if cells are big, they might be on different regions / regionservers?

2012/10/10, Anoop Sam John <an...@huawei.com>:
> Hi
>     To your prePut() method you are getting an ObserverContext argument.
> From this you can easily get a ref to the current region.
> ctx.getEnvironment().getRegion()
> Directly make calls to this region object. Creation of the HTable instance
> and making a get() will be too much unwanted overhead.
>
> -Anoop-
> ________________________________________
> From: Wei Tan [wtan@us.ibm.com]
> Sent: Wednesday, October 10, 2012 2:05 AM
> To: hbase-user@hadoop.apache.org
> Subject: connect to the region from coprocessor
>
> Hi,
>
> In my preput coprocessor I would like to get the old value of the row been
> input. Now I am creating a HTable instance and using the get interface;
> function wise it works fine. Given the row is physically in the same
> region as the cp, is there any lightweight approach doing that?
>
> Thanks!
>
>
> Best Regards,
> Wei

Re: connect to the region from coprocessor

Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
But is it possible that the previous value for this row to be stored
in another region?

I mean, if cells are big, they might be on different regions / regionservers?

2012/10/10, Anoop Sam John <an...@huawei.com>:
> Hi
>     To your prePut() method you are getting an ObserverContext argument.
> From this you can easily get a ref to the current region.
> ctx.getEnvironment().getRegion()
> Directly make calls to this region object. Creation of the HTable instance
> and making a get() will be too much unwanted overhead.
>
> -Anoop-
> ________________________________________
> From: Wei Tan [wtan@us.ibm.com]
> Sent: Wednesday, October 10, 2012 2:05 AM
> To: hbase-user@hadoop.apache.org
> Subject: connect to the region from coprocessor
>
> Hi,
>
> In my preput coprocessor I would like to get the old value of the row been
> input. Now I am creating a HTable instance and using the get interface;
> function wise it works fine. Given the row is physically in the same
> region as the cp, is there any lightweight approach doing that?
>
> Thanks!
>
>
> Best Regards,
> Wei

RE: connect to the region from coprocessor

Posted by Wei Tan <wt...@us.ibm.com>.
Thank you Anoop and that is a very helpful suggestion.


Best Regards,
Wei





From:   Anoop Sam John <an...@huawei.com>
To:     "user@hbase.apache.org" <us...@hbase.apache.org>, 
"hbase-user@hadoop.apache.org" <hb...@hadoop.apache.org>, 
Date:   10/10/2012 05:22 AM
Subject:        RE: connect to the region from coprocessor



Hi
    To your prePut() method you are getting an ObserverContext argument. 
>From this you can easily get a ref to the current region.
ctx.getEnvironment().getRegion()
Directly make calls to this region object. Creation of the HTable instance 
and making a get() will be too much unwanted overhead.

-Anoop-
________________________________________
From: Wei Tan [wtan@us.ibm.com]
Sent: Wednesday, October 10, 2012 2:05 AM
To: hbase-user@hadoop.apache.org
Subject: connect to the region from coprocessor

Hi,

In my preput coprocessor I would like to get the old value of the row been
input. Now I am creating a HTable instance and using the get interface;
function wise it works fine. Given the row is physically in the same
region as the cp, is there any lightweight approach doing that?

Thanks!


Best Regards,
Wei


RE: connect to the region from coprocessor

Posted by Anoop Sam John <an...@huawei.com>.
Hi
    To your prePut() method you are getting an ObserverContext argument. From this you can easily get a ref to the current region.
ctx.getEnvironment().getRegion()
Directly make calls to this region object. Creation of the HTable instance and making a get() will be too much unwanted overhead.

-Anoop-
________________________________________
From: Wei Tan [wtan@us.ibm.com]
Sent: Wednesday, October 10, 2012 2:05 AM
To: hbase-user@hadoop.apache.org
Subject: connect to the region from coprocessor

Hi,

In my preput coprocessor I would like to get the old value of the row been
input. Now I am creating a HTable instance and using the get interface;
function wise it works fine. Given the row is physically in the same
region as the cp, is there any lightweight approach doing that?

Thanks!


Best Regards,
Wei