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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to