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

stack commented on HBASE-5448:
------------------------------

[~ghelmling] One other question G.  How to do exceptions in a coprocessor?  I 
see where we set the exception on the controller if there is one, but should we 
then abandon further processing -- return?  We need to call the RpcCallback 
done, though, right?

Here is example from tail of an endpoint cp implementation:

{code}
...
    } catch (IOException e) {
      ResponseConverter.setControllerException(controller, e);
      // Set result to -1 to indicate error.
      sumResult = -1;
      LOG.info("Setting sum result to -1 to indicate error", e);
    } finally {
      if (scanner != null) {
        try {
          scanner.close();
        } catch (IOException e) {
          ResponseConverter.setControllerException(controller, e);
          sumResult = -1;
          LOG.info("Setting sum result to -1 to indicate error", e);
        }
      }
    }
    done.run(SumResponse.newBuilder().setSum(sumResult).build());
  }
{code}

Is that how you'd do it?

Thanks.
                
> Support for dynamic coprocessor endpoints with PB-based RPC
> -----------------------------------------------------------
>
>                 Key: HBASE-5448
>                 URL: https://issues.apache.org/jira/browse/HBASE-5448
>             Project: HBase
>          Issue Type: Sub-task
>          Components: IPC/RPC, master, migration, regionserver
>            Reporter: Todd Lipcon
>            Assignee: Gary Helmling
>             Fix For: 0.96.0
>
>         Attachments: HBASE-5448_2.patch, HBASE-5448_3.patch, 
> HBASE-5448_4.patch, HBASE-5448.patch
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to