frankvicky commented on code in PR #19448:
URL: https://github.com/apache/kafka/pull/19448#discussion_r2039603484


##########
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:
   In the current use case, this looks like a workaround for setting 
`KRaftVersionRecord`.



-- 
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

Reply via email to