public void writeTo(ByteBuf buf) {
    buf.writeBytes(partitionId.getBytes());
    if (responseVersion == ReplicaMetadataResponse.REPLICA_METADATA_RESPONSE_VERSION_V_6) {
      buf.writeShort((short) replicaType.ordinal());
    }
    buf.writeShort((short) errorCode.ordinal());
    if (errorCode == ServerErrorCode.NoError) {
      buf.writeBytes(token.toBytes());
      messageInfoAndMetadataListSerde.serializeMessageInfoAndMetadataList(buf);
      buf.writeLong(remoteReplicaLagInBytes);
    }
  }
Contains the token, messageInfoList, remoteReplicaLag for a local partition. This is used
by replica metadata response to specify information for a partition
ambry-protocol/src/main/java/com/github/ambry/protocol/ReplicaMetadataResponseInfo.java