public void write(ImageWriter writer, ImageWriterOptions options) {
        // Features should be written out first so we can include the metadata.version at the beginning of the
        // snapshot
        features.write(writer, options);
        cluster.write(writer, options);
        topics.write(writer, options);
        configs.write(writer, options);
        clientQuotas.write(writer, options);
        producerIds.write(writer, options);
        acls.write(writer, options);
        scram.write(writer, options);
        delegationTokens.write(writer, options);
        // AutoMQ for Kafka inject start
        streamMetadata.write(writer, options);
        objectsMetadata.write(writer, options);
        kv.write(writer, options);
        // AutoMQ for Kafka inject end
        writer.close(true);
    }
The broker metadata image.

This class is thread-safe.
metadata/src/main/java/org/apache/kafka/image/MetadataImage.java