@Override
    public long freeze() {
        finalizeSnapshotWithFooter();
        appendBatches(accumulator.drain());
        snapshot.freeze();
        accumulator.close();
        return snapshot.sizeInBytes();
    }
Adds a {@link SnapshotFooterRecord} to the snapshot

No more records should be appended to the snapshot after calling this method
raft/src/main/java/org/apache/kafka/snapshot/RecordsSnapshotWriter.java