public Builder setMetadataVersion(MetadataVersion metadataVersion) {
            this.requestedMetadataVersion = metadataVersion;
            if (metadataVersion.isLessThan(MetadataVersion.MINIMUM_BOOTSTRAP_VERSION)) {
                // When writing an image, all versions less than 3.3-IV0 are treated as 3.0-IV1.
                // This is because those versions don't support FeatureLevelRecord.
                this.metadataVersion = MetadataVersion.MINIMUM_KRAFT_VERSION;
            } else {
                this.metadataVersion = metadataVersion;
            }
            return this;
        }
The options to use when writing an image.
metadata/src/main/java/org/apache/kafka/image/writer/ImageWriterOptions.java