Apache9 commented on a change in pull request #126: HBASE-21718 Implement Admin
based on AsyncAdmin
URL: https://github.com/apache/hbase/pull/126#discussion_r273456472
##########
File path:
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionUtils.java
##########
@@ -684,4 +685,21 @@ static void shutdownPool(ExecutorService pool) {
pool.shutdownNow();
}
}
+
+ static void setCoprocessorError(com.google.protobuf.RpcController
controller, Throwable error) {
+ if (controller == null) {
+ return;
+ }
+ if (controller instanceof ServerRpcController) {
+ if (error instanceof IOException) {
+ ((ServerRpcController) controller).setFailedOn((IOException) error);
+ } else {
+ ((ServerRpcController) controller).setFailedOn(new IOException(error));
+ }
+ } else if (controller instanceof ClientCoprocessorRpcController) {
+ ((ClientCoprocessorRpcController) controller).setFailed(error);
+ } else {
+ controller.setFailed(error.toString());
Review comment:
We will try our best to set the exception directly here, as the original
RpcController interface does not provide a method to set an exception, so if
there is no way to set the exception directly we will set the error message
instead.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services