ijuma commented on code in PR #18845: URL: https://github.com/apache/kafka/pull/18845#discussion_r1960679302
########## metadata/src/main/java/org/apache/kafka/image/writer/ImageWriterOptions.java: ########## @@ -29,30 +29,22 @@ public final class ImageWriterOptions { public static class Builder { private MetadataVersion metadataVersion; - private MetadataVersion requestedMetadataVersion; - private boolean isEligibleLeaderReplicasEnabled = false; private Consumer<UnwritableMetadataException> lossHandler = e -> { throw e; }; + private boolean isEligibleLeaderReplicasEnabled = false; - public Builder() { - this.metadataVersion = MetadataVersion.latestProduction(); + public Builder(MetadataVersion metadataVersion) { + this.metadataVersion = metadataVersion; } public Builder(MetadataImage image) { - this.metadataVersion = image.features().metadataVersion(); + this.metadataVersion = image.features().metadataVersionOrThrow(); this.isEligibleLeaderReplicasEnabled = image.features().isElrEnabled(); } public Builder setMetadataVersion(MetadataVersion metadataVersion) { Review Comment: This is a general pattern for the metadata module, I would rather not change it as part of this PR. We can have that discussion via a separate JIRA if useful. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org