return delegate.getClient(serverName);
}
// the client is attempting to write to the same regionserver, we can short-circuit to our
// local regionserver
final BlockingService blocking = ClientService.newReflectiveBlockingService(this.server);
final RpcServerInterface rpc = this.server.getRpcServer();
final MonitoredRPCHandler status =
TaskMonitor.get().createRPCStatus(Thread.currentThread().getName());
status.pause("Setting up server-local call");
final long timestamp = EnvironmentEdgeManager.currentTimeMillis();
BlockingRpcChannel channel = new BlockingRpcChannel() {
@Override
public Message callBlockingMethod(MethodDescriptor method, RpcController controller,
Message request, Message responsePrototype) throws ServiceException {
try {
// we never need a cell-scanner - everything is already fully formed
return rpc.call(blocking, method, request, null, timestamp, status).getFirst();
} catch (IOException e) {
throw new ServiceException(e);
}
}
};