You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Duo Zhang (JIRA)" <ji...@apache.org> on 2017/01/20 07:30:26 UTC

[jira] [Comment Edited] (HBASE-17346) Add coprocessor service support

    [ https://issues.apache.org/jira/browse/HBASE-17346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15829428#comment-15829428 ] 

Duo Zhang edited comment on HBASE-17346 at 1/20/17 7:29 AM:
------------------------------------------------------------

The stubMaker and callable are just bridges to the generated protobuf code. A stubMaker is usually a {{XXXService.newStub(RpcChannel)}} method call, and the callable is usually a {{stub.xxx(RpcController, Message, RpcCallback)}} call. All the parameters will be prepared by us and user just need to pass them to the right method.
Yes it exposes some internals to user so that's why I just keep them in the RawAsyncTable interface. It should only be used by advanced users.

{quote}
The channel and controller we get from where? Ditto 'done' I don't see them in the aggregation class.
{quote}
See the RegionCoprocessorRpcChannelImpl class.

And for the callback, onRegionComplete is used to tell you that there is a result for a particular region, and onComplete is used to tell you that the operation is finished, i.e., there is no new onRegionComplete. This is because the region locator itself is also asynchronous, and I want to send actual request to region on the fly, i.e., send a request immediately after we get the location of a region without getting all the regions and their locations. So we need to find a way to tell user that there is no new region, that's why we have an onComplete method.

And the onError method is called when locating error. Typically onRegionError and onError have the same effect that you should fail the whole operation as we have already retried many times.

{quote}
You don't need PayloadCarryingRpcController here, right
{quote}
PCRC extends the shaded RpcController, we can not use it for coprocessor call...

Thanks.


was (Author: apache9):
The stubMaker and callable are just bridges to the generated protobuf code. A stubMaker is usually a {{XXXService.newStub(RpcChannel)}} method call, and the callable is usually a {{stub.xxx(RpcController, Message, RpcCallback)}} call. All the parameters will be prepared by us and user just need to pass them to the right method.
Yes it exposes some internals to user so that's why I just keep them in the RawAsyncTable interface. It should only be used by advanced users.

{quote}
The channel and controller we get from where? Ditto 'done' I don't see them in the aggregation class.
{quote}
See the RegionCoprocessorRpcChannelImpl class.

And for the callback, onRegionComplete is used to tell you that there is a result for a particular region, and onComplete is used to tell you that the operation is finished, i.e., there is no new onRegionComplete. This is because the region locator itself is also asynchronous, and I want to send actual request to region on the fly, i.e., send a request immediately after we get the location of a region without getting all the region and their locations. So we need to find a way to tell user that there is no region, that's why we have an onComplete method.

And the onError method is called when locating error. Typically onRegionError and onError have the same effect that you should fail the whole operation as we have already retried many times.

{quote}
You don't need PayloadCarryingRpcController here, right
{quote}
PCRC extends the shaded RpcController, we can not use it for coprocessor call...

Thanks.

> Add coprocessor service support
> -------------------------------
>
>                 Key: HBASE-17346
>                 URL: https://issues.apache.org/jira/browse/HBASE-17346
>             Project: HBase
>          Issue Type: Sub-task
>          Components: asyncclient, Client, Coprocessors
>    Affects Versions: 2.0.0
>            Reporter: Duo Zhang
>            Assignee: Duo Zhang
>             Fix For: 2.0.0
>
>         Attachments: 17346.suggestion.txt, HBASE-17346.patch, HBASE-17346-v1.patch
>
>
> I think we need to redesign the API.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)