cmccabe commented on code in PR #16230: URL: https://github.com/apache/kafka/pull/16230#discussion_r1669277905
########## metadata/src/main/java/org/apache/kafka/metadata/bootstrap/BootstrapMetadata.java: ########## @@ -73,6 +80,22 @@ public static Optional<MetadataVersion> recordToMetadataVersion(ApiMessage recor return Optional.empty(); } + private static ApiMessageAndVersion kraftVersionToRecord(KRaftVersion version) { + return new ApiMessageAndVersion(new FeatureLevelRecord(). + setName(KRaftVersion.FEATURE_NAME). + setFeatureLevel(version.featureLevel()), (short) 0); + } + + private static Optional<KRaftVersion> recordToKRaftVersion(ApiMessage record) { + if (record instanceof FeatureLevelRecord) { + FeatureLevelRecord featureLevel = (FeatureLevelRecord) record; + if (featureLevel.name().equals(KRaftVersion.FEATURE_NAME)) { + return Optional.of(KRaftVersion.fromFeatureLevel(featureLevel.featureLevel())); + } + } + return Optional.empty(); + } Review Comment: ack -- 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