jsancio commented on code in PR #21122:
URL: https://github.com/apache/kafka/pull/21122#discussion_r2920400212
##########
server-common/src/main/java/org/apache/kafka/server/common/FinalizedFeatures.java:
##########
@@ -20,27 +20,125 @@
import java.util.Map;
import java.util.Objects;
-public record FinalizedFeatures(
- MetadataVersion metadataVersion,
- Map<String, Short> finalizedFeatures,
- long finalizedFeaturesEpoch
-) {
- public static FinalizedFeatures fromKRaftVersion(MetadataVersion version) {
- return new FinalizedFeatures(version, Map.of(), -1);
- }
+/**
+ * Represents the finalized feature levels for a Kafka cluster.
+ * <p>
+ * This class can be in one of three states:
+ * <ul>
+ * <li>Unknown - metadata version is not yet known (use {@link
#unknown()})</li>
+ * <li>KRaft version only - only metadata version is known (use {@link
#fromKRaftVersion(MetadataVersion)})</li>
Review Comment:
KRaft version only? Do you mean metadata version only?
I would suggest adding context when is unknown used vs metadata only vs
"full features".
##########
server-common/src/test/java/org/apache/kafka/server/common/FinalizedFeaturesTest.java:
##########
@@ -24,12 +24,54 @@
import static org.apache.kafka.server.common.MetadataVersion.FEATURE_NAME;
import static org.apache.kafka.server.common.MetadataVersion.MINIMUM_VERSION;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
class FinalizedFeaturesTest {
Review Comment:
Thanks for the new tests. They look good.
--
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]