in ratis-hadoop/src/main/java/org/apache/ratis/hadooprpc/server/HadoopRpcService.java [195:213]
private <REQUEST extends GeneratedMessageV3, REPLY> REPLY processRequest(
REQUEST request, org.apache.ratis.thirdparty.com.google.protobuf.ByteString replyId,
ServerOps type, CheckedFunction<byte[], REPLY, InvalidProtocolBufferException> func)
throws IOException {
CodeInjectionForTesting.execute(SEND_SERVER_REQUEST, getId(), null, request);
ServerRequestProto p = ServerRequestProto.newBuilder()
.setRequest(ByteString.copyFrom(request.toByteArray()))
.setType(type)
.build();
final RaftServerProtocolPB proxy = getProxies().getProxy(
RaftPeerId.valueOf(replyId)).getProtocol();
try {
byte[] replyBytes = proxy.sendServer(null, p).getResponse().toByteArray();
return func.apply(replyBytes);
} catch (Exception se) {
throw new IOException(se);
}
}