public MemoryRecords build() {
        if (aborted) {
            throw new IllegalStateException("Attempting to build an aborted record batch");
        }
        close();
        return builtRecords;
    }
Close this builder and return the resulting buffer.
@return The built log buffer
clients/src/main/java/org/apache/kafka/common/record/MemoryRecordsBuilder.java