jsancio commented on code in PR #16230:
URL: https://github.com/apache/kafka/pull/16230#discussion_r1639917661
##########
metadata/src/main/java/org/apache/kafka/metadata/bootstrap/BootstrapMetadata.java:
##########
@@ -116,6 +139,34 @@ public BootstrapMetadata copyWithOnlyVersion() {
metadataVersion, source);
}
+ public BootstrapMetadata withMetadataVersion(MetadataVersion
metadataVersion) {
+ List<ApiMessageAndVersion> newRecords = new ArrayList<>();
+ for (ApiMessageAndVersion record : records) {
+ if (recordToMetadataVersion(record.message()).isPresent()) {
+ newRecords.add(metadataVersionToRecord(metadataVersion));
+ } else {
+ newRecords.add(record);
+ }
+ }
+ return new BootstrapMetadata(newRecords, metadataVersion, source);
+ }
+
+ public BootstrapMetadata withKRaftVersion(KRaftVersion version) {
+ List<ApiMessageAndVersion> newRecords = new ArrayList<>();
+ boolean foundKRaftVersion = false;
+ for (ApiMessageAndVersion record : records) {
+ if (recordToKRaftVersion(record.message()).isPresent()) {
+ newRecords.add(kraftVersionToRecord(version));
Review Comment:
See my comment but we shouldn't implement kraft.version in the metadata
layer (metadata module). It should be implemented in the kraft layer (module).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]