You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "mannoopj (via GitHub)" <gi...@apache.org> on 2026/02/03 16:11:31 UTC

Re: [PR] KAFKA-19964: API Versions Response returns minimum metadata version for finalized level when no quorum exists [kafka]

mannoopj commented on code in PR #21122:
URL: https://github.com/apache/kafka/pull/21122#discussion_r2759858581


##########
server-common/src/main/java/org/apache/kafka/server/common/FinalizedFeatures.java:
##########
@@ -19,25 +19,30 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Optional;
 
 public record FinalizedFeatures(
-    MetadataVersion metadataVersion,
+    Optional<MetadataVersion> metadataVersion,
     Map<String, Short> finalizedFeatures,
     long finalizedFeaturesEpoch
 ) {
+    public static final FinalizedFeatures UNKNOWN_FINALIZED_FEATURES =
+        new FinalizedFeatures(Optional.empty(), Map.of(), -1);
+
     public static FinalizedFeatures fromKRaftVersion(MetadataVersion version) {
-        return new FinalizedFeatures(version, Map.of(), -1);
+        return new FinalizedFeatures(Optional.of(version), Map.of(), -1);
     }
 
     public FinalizedFeatures(
-        MetadataVersion metadataVersion,
+        Optional<MetadataVersion> metadataVersion,
         Map<String, Short> finalizedFeatures,
         long finalizedFeaturesEpoch

Review Comment:
   yes i agree its probably best to limit the construction of this type. I dont see any other possible values as well. 



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org