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

Duo Zhang commented on HBASE-17346:
-----------------------------------

{quote}
Do s/done/callback/g I'd say. 'done' I don't get when I see it in your javadoc 
example. 'callback' I can follow and 'callback' makes it look like a protobuf 
service invocation.
{quote}
'done' is the name of the RpcCallback for a method in a protobuf service, see 
this:
{code}
      public abstract void getMax(
          com.google.protobuf.RpcController controller,
          
org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateRequest 
request,
          
com.google.protobuf.RpcCallback<org.apache.hadoop.hbase.protobuf.generated.AggregateProtos.AggregateResponse>
 done);
{code}
That's why I always use '(stub, controller,  done) -> stub.xxx(controller, 
request, done)' as the example. For me 'done' and 'callback' are both OK. I'm 
not sure which one is better.

{quote}
Javadoc talks of whenComplete and onComplete?
{quote}
'whenComplete' is 'CompletableFuture.whenComplete'. The pseudo code just wang 
to show you how CoprocessorCallback will be called during a ranged coprocessor 
service call.

{quote}
We have onRegionComplete and onComplete in the Interface but onRegionComplete 
is not called any more? Or if onRegionComplete, then it happens when we are 
totally done with the region?
{quote}
Oh sorry for my English, I mean 'no more onRegionComplete calls in the future'. 
You can see the pseudo code. We will start locating from the startKey. When 
locating complete, if we have not covered the whole range, then send another 
locating request. At the same time, we will send the actual coprocessor call to 
the located region. When we get the response of the region, we either call 
onRegionComplete or onRegionError. If we have already sent all the requests, 
and there is no pending request, then we call onComplete.

> 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, HBASE-17346-v2.patch, HBASE-17346-v3.patch
>
>
> I think we need to redesign the API.



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

Reply via email to