public long getLength()

in ratis-logservice/src/main/java/org/apache/ratis/logservice/impl/LogStreamImpl.java [127:142]


  public long getLength() throws IOException {
    RaftClientReply reply = raftClient
        .io().sendReadOnly(Message.valueOf(LogServiceProtoUtil
            .toGetLengthRequestProto(name).toByteString()));
    if (reply.getException() != null) {
      throw new IOException(reply.getException());
    }

    GetLogLengthReplyProto proto =
        GetLogLengthReplyProto.parseFrom(reply.getMessage().getContent());
    if (proto.hasException()) {
      LogServiceException e = proto.getException();
      throw new IOException(e.getErrorMsg());
    }
    return proto.getLength();
  }