dongnuo123 commented on code in PR #17886:
URL: https://github.com/apache/kafka/pull/17886#discussion_r1870045092
##########
server-common/src/main/java/org/apache/kafka/server/common/TestFeatureVersion.java:
##########
@@ -16,22 +16,57 @@
*/
package org.apache.kafka.server.common;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
public enum TestFeatureVersion implements FeatureVersion {
TEST_0(0, MetadataVersion.MINIMUM_KRAFT_VERSION, Collections.emptyMap()),
// TEST_1 released right before MV 3.7-IVO was released, and it has no
dependencies
TEST_1(1, MetadataVersion.IBP_3_7_IV0, Collections.emptyMap()),
- // TEST_2 is not yet released and maps to the latest testing version, and
it depends on this metadata version
- TEST_2(2, MetadataVersion.latestTesting(),
Collections.singletonMap(MetadataVersion.FEATURE_NAME,
MetadataVersion.latestTesting().featureLevel()));
+ // TEST_2 is not yet set to be the default version and maps to the latest
testing version, and it depends on this metadata version
+ TEST_2(2, MetadataVersion.latestTesting(),
Collections.singletonMap(MetadataVersion.FEATURE_NAME,
MetadataVersion.latestTesting().featureLevel())),
+
+ /**
+ * Test versions only used for unit test FeatureTest.java.
+ */
+ // For testing latest production is not one of the feature versions.
+ UT_FV0_0(0, MetadataVersion.MINIMUM_KRAFT_VERSION, Collections.emptyMap()),
+ UT_FV0_1(1, MetadataVersion.IBP_3_7_IV0, Collections.emptyMap()),
+
+ // For testing latest production is lagged behind the default value.
+ UT_FV1_0(0, MetadataVersion.MINIMUM_KRAFT_VERSION, Collections.emptyMap()),
+ UT_FV1_1(1, MetadataVersion.IBP_3_7_IV0, Collections.emptyMap()),
+
+ // For testing the dependency of the latest production that is not yet
production ready.
+ UT_FV2_0(0, MetadataVersion.MINIMUM_KRAFT_VERSION, Collections.emptyMap()),
+ UT_FV2_1(1, MetadataVersion.IBP_3_7_IV0, Collections.emptyMap()),
+ UT_FV3_0(0, MetadataVersion.MINIMUM_KRAFT_VERSION, Collections.emptyMap()),
+ UT_FV3_1(1, MetadataVersion.IBP_3_7_IV0,
Collections.singletonMap("unit.test.feature.version.2", (short) 1)),
+
+ // For testing the dependency of the default value that is not yet default
ready.
+ UT_FV4_0(0, MetadataVersion.MINIMUM_KRAFT_VERSION, Collections.emptyMap()),
+ UT_FV4_1(1, MetadataVersion.latestTesting(), Collections.emptyMap()),
+ UT_FV5_0(0, MetadataVersion.MINIMUM_KRAFT_VERSION, Collections.emptyMap()),
+ UT_FV5_1(1, MetadataVersion.IBP_3_7_IV0,
Collections.singletonMap("unit.test.feature.version.4", (short) 1)),
+
+ // For testing the latest production has MV dependency that is not yet
production ready.
+ UT_FV6_0(0, MetadataVersion.MINIMUM_KRAFT_VERSION, Collections.emptyMap()),
+ UT_FV6_1(1, MetadataVersion.latestTesting(),
Collections.singletonMap(MetadataVersion.FEATURE_NAME,
MetadataVersion.latestTesting().featureLevel())),
+
+ // For testing the default value has MV dependency that is ahead of the
bootstrap MV.
Review Comment:
Ah you're right. Thanks for the catch!
--
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]