Skip to content

Commit 6dd2cc7

Browse files
authored
MINOR: Clean up comments and remove unused code in RecordVersion and CreateTopicsRequestTest (#19342)
## Summary This PR updates the `RecordVersion` javadoc for clarity. It removes outdated references to `message.format.version` mentioned in the [Kafka 4.0 upgrade documentation](https://github.com/apache/kafka-site/blob/48f06981ee81ea56b94918c01f399b0b64c98e0b/40/upgrade.html#L135) and aligns with feedback from a previous discussion in [#19325 ](#19325). ## Changes - Cleaned up javadoc in `RecordVersion` - Removed outdated or deprecated references Reviewers: PoAn Yang <[email protected]>, Ken Huang <[email protected]>, Chia-Ping Tsai <[email protected]>
1 parent 6d68f8a commit 6dd2cc7

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

Diff for: clients/src/main/java/org/apache/kafka/common/record/RecordVersion.java

+1-11
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
* Defines the record format versions supported by Kafka.
2121
*
2222
* For historical reasons, the record format version is also known as `magic` and `message format version`. Note that
23-
* the version actually applies to the {@link RecordBatch} (instead of the {@link Record}). Finally, the
24-
* `message.format.version` topic config confusingly expects an ApiVersion instead of a RecordVersion.
23+
* the version actually applies to the {@link RecordBatch} (instead of the {@link Record}).
2524
*/
2625
public enum RecordVersion {
2726
V0(0), V1(1), V2(2);
@@ -34,15 +33,6 @@ public enum RecordVersion {
3433
this.value = (byte) value;
3534
}
3635

37-
/**
38-
* Check whether this version precedes another version.
39-
*
40-
* @return true only if the magic value is less than the other's
41-
*/
42-
public boolean precedes(RecordVersion other) {
43-
return this.value < other.value;
44-
}
45-
4636
public static RecordVersion lookup(byte value) {
4737
if (value < 0 || value >= VALUES.length)
4838
throw new IllegalArgumentException("Unknown record version: " + value);

Diff for: core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala

-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ class CreateTopicsRequestTest extends AbstractCreateTopicsRequestTest {
7777
validateErrorCreateTopicsRequests(topicsReq(Seq(topicReq("error-config",
7878
config=Map("not.a.property" -> "error")))),
7979
Map("error-config" -> error(Errors.INVALID_CONFIG)), checkErrorMessage = false)
80-
validateErrorCreateTopicsRequests(topicsReq(Seq(topicReq("error-config-value",
81-
config=Map("message.format.version" -> "invalid-value")))),
82-
Map("error-config-value" -> error(Errors.INVALID_CONFIG)), checkErrorMessage = false)
8380
validateErrorCreateTopicsRequests(topicsReq(Seq(topicReq("error-assignment",
8481
assignment=Map(0 -> List(0, 1), 1 -> List(0))))),
8582
Map("error-assignment" -> error(Errors.INVALID_REPLICA_ASSIGNMENT)), checkErrorMessage = false)

0 commit comments

Comments
 (0)