std::size_t TupleOutputStream::writeRow(const TableTuple &tuple)
{
    const std::size_t startPos = position();
    tuple.serializeTo(*this, true);
    const std::size_t endPos = position();
    m_rowCount++;
    std::size_t bytesSerialized = endPos - startPos;
    m_totalBytesSerialized += bytesSerialized;
    return bytesSerialized;
}
/*
 * Add a tuple to be inserted or updated at the recovering partition.
 */
void RecoveryProtoMsgBuilder::addTuple(TableTuple tuple) {
    assert(m_out);
    assert(canAddMoreTuples());
    tuple.serializeTo(*m_out);
    m_tupleCount++;
}