frankvicky commented on code in PR #19448: URL: https://github.com/apache/kafka/pull/19448#discussion_r2039583366
########## metadata/src/main/java/org/apache/kafka/metadata/bootstrap/BootstrapMetadata.java: ########## @@ -149,6 +149,32 @@ public BootstrapMetadata copyWithOnlyVersion() { metadataVersion, source); } + public BootstrapMetadata copyWithFeatureRecord(String featureName, short level) { + List<ApiMessageAndVersion> newRecords = new ArrayList<>(); + int i = 0; + while (i < records.size()) { + if (records.get(i).message() instanceof FeatureLevelRecord) { + FeatureLevelRecord record = (FeatureLevelRecord) records.get(i).message(); + if (record.name().equals(featureName)) { + FeatureLevelRecord newRecord = record.duplicate(); + newRecord.setFeatureLevel(level); + newRecords.add(new ApiMessageAndVersion(newRecord, (short) 0)); + break; Review Comment: Do we need a comment for this method? It seems that this is a workaround for a particular scenario. Otherwise, there is no reason we should break in a "copy" method. -- 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