public SnapshotGenerator build() {
            if (disabledReason == null) {
                disabledReason = new AtomicReference<>();
            }
            return new SnapshotGenerator(
                nodeId,
                time,
                emitter,
                faultHandler,
                maxBytesSinceLastSnapshot,
                maxTimeSinceLastSnapshotNs,
                disabledReason,
                threadNamePrefix
            );
        }
A metadata publisher that generates snapshots when appropriate.
metadata/src/main/java/org/apache/kafka/image/publisher/SnapshotGenerator.java