in ratis-logservice/src/main/java/org/apache/ratis/logservice/impl/LogWriterImpl.java [68:87]
public List<Long> write(List<ByteBuffer> list) throws IOException {
try {
RaftClientReply reply = raftClient.io().send(
Message.valueOf(LogServiceProtoUtil.toAppendBBEntryLogRequestProto(parent.getName(), list).toByteString()));
if (reply.getException() != null) {
throw new IOException(reply.getException());
}
AppendLogEntryReplyProto proto = AppendLogEntryReplyProto.parseFrom(reply.getMessage().getContent());
if (proto.hasException()) {
LogServiceException e = proto.getException();
throw new IOException(e.getErrorMsg());
}
List<Long> ids = proto.getRecordIdList();
// The above call Always returns one id (regardless of a batch size)
return ids;
} catch (Exception e) {
throw new IOException(e);
}
}