public void reopenAndRewriteProducerState(long producerId, short producerEpoch, int baseSequence, boolean isTransactional) {
        if (aborted)
            throw new IllegalStateException("Should not reopen a batch which is already aborted.");
        builtRecords = null;
        this.producerId = producerId;
        this.producerEpoch = producerEpoch;
        this.baseSequence = baseSequence;
        this.isTransactional = isTransactional;
    }
Release resources required for record appends (e.g. compression buffers). Once this method is called, it's only
possible to update the RecordBatch header.
clients/src/main/java/org/apache/kafka/common/record/MemoryRecordsBuilder.java