public CoprocessorServiceResponse call() throws Exception {
byte[] regionName = getLocation().getRegionInfo().getRegionName();
return ProtobufUtil.execService(getStub(), call, regionName);
}
};
CoprocessorServiceResponse result = rpcFactory.<CoprocessorServiceResponse> newCaller()
.callWithRetries(callable);
Message response = null;
if (result.getValue().hasValue()) {
response = responsePrototype.newBuilderForType()
.mergeFrom(result.getValue().getValue()).build();
} else {
response = responsePrototype.getDefaultInstanceForType();
}
lastRegion = result.getRegion().getValue().toByteArray();
if (LOG.isTraceEnabled()) {
LOG.trace("Result is region=" + Bytes.toStringBinary(lastRegion) + ", value=" + response);
}
return response;
}