public void abort() {
        closeForRecordAppends();
        buffer().position(initialPosition);
        aborted = true;
    }
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