You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Pradeep Gollakota <pr...@gmail.com> on 2014/01/22 01:32:19 UTC

Coprocessor Client Blocking

Hi All,

In the blog describing the coprocessor there was sequence diagram walking
through the lifecycle of a Get.
https://blogs.apache.org/hbase/mediaresource/60b135e5-04c6-4197-b262-e7cd08de784b

I'm wondering if the lifecycle of a Put follows the same sequence.
Specifically for my use case, I'm doing some processing using a
RegionObserver in the postPut() method. Does the client wait until the
postPut() is executed? When is the control returned to the client in a Put?

Thanks!

Re: Coprocessor Client Blocking

Posted by Pradeep Gollakota <pr...@gmail.com>.
Thank you!


On Tue, Jan 21, 2014 at 4:52 PM, Ted Yu <yu...@gmail.com> wrote:

> bq. Does the client wait until the postPut() is executed?
>
> Yes.
>
> Please see HRegion#doMiniBatchMutation()
> In 0.94, it is around line 2521.
>
> Cheers
>
>
> On Tue, Jan 21, 2014 at 4:32 PM, Pradeep Gollakota <pradeepg26@gmail.com
> >wrote:
>
> > Hi All,
> >
> > In the blog describing the coprocessor there was sequence diagram walking
> > through the lifecycle of a Get.
> >
> >
> https://blogs.apache.org/hbase/mediaresource/60b135e5-04c6-4197-b262-e7cd08de784b
> >
> > I'm wondering if the lifecycle of a Put follows the same sequence.
> > Specifically for my use case, I'm doing some processing using a
> > RegionObserver in the postPut() method. Does the client wait until the
> > postPut() is executed? When is the control returned to the client in a
> Put?
> >
> > Thanks!
> >
>

Re: Coprocessor Client Blocking

Posted by Ted Yu <yu...@gmail.com>.
bq. Does the client wait until the postPut() is executed?

Yes.

Please see HRegion#doMiniBatchMutation()
In 0.94, it is around line 2521.

Cheers


On Tue, Jan 21, 2014 at 4:32 PM, Pradeep Gollakota <pr...@gmail.com>wrote:

> Hi All,
>
> In the blog describing the coprocessor there was sequence diagram walking
> through the lifecycle of a Get.
>
> https://blogs.apache.org/hbase/mediaresource/60b135e5-04c6-4197-b262-e7cd08de784b
>
> I'm wondering if the lifecycle of a Put follows the same sequence.
> Specifically for my use case, I'm doing some processing using a
> RegionObserver in the postPut() method. Does the client wait until the
> postPut() is executed? When is the control returned to the client in a Put?
>
> Thanks!
>

Re: Coprocessor Client Blocking

Posted by Rural Hunter <ru...@gmail.com>.
I have another question related to this. What will happen if the 
postPut() throws an exception? will the client receive the exception but 
the put is actual successful?

于 2014/1/22 8:57, Gary Helmling 写道:
> Yes, the pre/post method calls for the Observer hooks (RegionObserver for
> postPut()) are executed synchronously on the RPC calling path.  So the
> RegionServer will not return the response to the client until your
> postPut() method has returned.  In general, this means that for best
> performance you should only load Observers that you need, and any Observers
> you write should do their processing as efficiently as possible.
>


Re: Coprocessor Client Blocking

Posted by Gary Helmling <gh...@gmail.com>.
Yes, the pre/post method calls for the Observer hooks (RegionObserver for
postPut()) are executed synchronously on the RPC calling path.  So the
RegionServer will not return the response to the client until your
postPut() method has returned.  In general, this means that for best
performance you should only load Observers that you need, and any Observers
you write should do their processing as efficiently as possible.


On Tue, Jan 21, 2014 at 4:32 PM, Pradeep Gollakota <pr...@gmail.com>wrote:

> Hi All,
>
> In the blog describing the coprocessor there was sequence diagram walking
> through the lifecycle of a Get.
>
> https://blogs.apache.org/hbase/mediaresource/60b135e5-04c6-4197-b262-e7cd08de784b
>
> I'm wondering if the lifecycle of a Put follows the same sequence.
> Specifically for my use case, I'm doing some processing using a
> RegionObserver in the postPut() method. Does the client wait until the
> postPut() is executed? When is the control returned to the client in a Put?
>
> Thanks!
>