@Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append(partitionId);
    sb.append(replicaType.name());
    sb.append(" ServerErrorCode=").append(errorCode);
    if (errorCode == ServerErrorCode.NoError) {
      List<MessageInfo> messageInfos = messageInfoAndMetadataListSerde.getMessageInfoList();
      sb.append(" Token=").append(token);
      sb.append(" MessagesTotalSize=").append(totalSizeOfAllMessages);
      if (messageInfos != null) {
        int size = messageInfos.size();
        sb.append(" MessageInfoListSize=").append(size);
        if (size > 0) {
          sb.append(" MessageInfoListFirstId=").append(messageInfos.get(0).getStoreKey());
          sb.append(" MessageInfoListLastId=").append(messageInfos.get(size - 1).getStoreKey());
        }
      }
      sb.append(" RemoteReplicaLagInBytes=").append(remoteReplicaLagInBytes);
    }
    return sb.toString();
  }
@return the cumulative size of all the messages represented by this response. 0 if the response signifies an error
ambry-protocol/src/main/java/com/github/ambry/protocol/ReplicaMetadataResponseInfo.java