This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 6dd2cc70c38 MINOR: Clean up comments and remove unused code in
RecordVersion and CreateTopicsRequestTest (#19342)
6dd2cc70c38 is described below
commit 6dd2cc70c386d8ef29e47c60af3c4341a53209a9
Author: Hong-Yi Chen <[email protected]>
AuthorDate: Mon Apr 7 07:47:06 2025 +0800
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
](https://github.com/apache/kafka/pull/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]>
---
.../java/org/apache/kafka/common/record/RecordVersion.java | 12 +-----------
.../scala/unit/kafka/server/CreateTopicsRequestTest.scala | 3 ---
2 files changed, 1 insertion(+), 14 deletions(-)
diff --git
a/clients/src/main/java/org/apache/kafka/common/record/RecordVersion.java
b/clients/src/main/java/org/apache/kafka/common/record/RecordVersion.java
index 8406d5331c8..13d6357d9b3 100644
--- a/clients/src/main/java/org/apache/kafka/common/record/RecordVersion.java
+++ b/clients/src/main/java/org/apache/kafka/common/record/RecordVersion.java
@@ -20,8 +20,7 @@ package org.apache.kafka.common.record;
* Defines the record format versions supported by Kafka.
*
* For historical reasons, the record format version is also known as `magic`
and `message format version`. Note that
- * the version actually applies to the {@link RecordBatch} (instead of the
{@link Record}). Finally, the
- * `message.format.version` topic config confusingly expects an ApiVersion
instead of a RecordVersion.
+ * the version actually applies to the {@link RecordBatch} (instead of the
{@link Record}).
*/
public enum RecordVersion {
V0(0), V1(1), V2(2);
@@ -34,15 +33,6 @@ public enum RecordVersion {
this.value = (byte) value;
}
- /**
- * Check whether this version precedes another version.
- *
- * @return true only if the magic value is less than the other's
- */
- public boolean precedes(RecordVersion other) {
- return this.value < other.value;
- }
-
public static RecordVersion lookup(byte value) {
if (value < 0 || value >= VALUES.length)
throw new IllegalArgumentException("Unknown record version: " +
value);
diff --git
a/core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala
b/core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala
index f4d2916986f..ca61193425a 100644
--- a/core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala
+++ b/core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala
@@ -77,9 +77,6 @@ class CreateTopicsRequestTest extends
AbstractCreateTopicsRequestTest {
validateErrorCreateTopicsRequests(topicsReq(Seq(topicReq("error-config",
config=Map("not.a.property" -> "error")))),
Map("error-config" -> error(Errors.INVALID_CONFIG)), checkErrorMessage =
false)
-
validateErrorCreateTopicsRequests(topicsReq(Seq(topicReq("error-config-value",
- config=Map("message.format.version" -> "invalid-value")))),
- Map("error-config-value" -> error(Errors.INVALID_CONFIG)),
checkErrorMessage = false)
validateErrorCreateTopicsRequests(topicsReq(Seq(topicReq("error-assignment",
assignment=Map(0 -> List(0, 1), 1 -> List(0))))),
Map("error-assignment" -> error(Errors.INVALID_REPLICA_ASSIGNMENT)),
checkErrorMessage = false)