mirror of https://github.com/apache/kafka.git
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](48f06981ee/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 <payang@apache.org>, Ken Huang
<s7133700@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
6d68f8a82c
commit
6dd2cc70c3
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue