mirror of https://github.com/apache/kafka.git
MINOR: Cleanup `toString` methods in Storage Module (#20432)
Getting rid of a bunch of `toString` functions in record classes in Storage Module. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
41611b4bd2
commit
d2a699954d
|
@ -18,12 +18,4 @@ package org.apache.kafka.storage.internals.log;
|
||||||
|
|
||||||
// Mapping of epoch to the first offset of the subsequent epoch
|
// Mapping of epoch to the first offset of the subsequent epoch
|
||||||
public record EpochEntry(int epoch, long startOffset) {
|
public record EpochEntry(int epoch, long startOffset) {
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "EpochEntry(" +
|
|
||||||
"epoch=" + epoch +
|
|
||||||
", startOffset=" + startOffset +
|
|
||||||
')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,12 +27,4 @@ public record LastRecord(OptionalLong lastDataOffset, short producerEpoch) {
|
||||||
public LastRecord {
|
public LastRecord {
|
||||||
Objects.requireNonNull(lastDataOffset, "lastDataOffset must be non null");
|
Objects.requireNonNull(lastDataOffset, "lastDataOffset must be non null");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "LastRecord(" +
|
|
||||||
"lastDataOffset=" + lastDataOffset +
|
|
||||||
", producerEpoch=" + producerEpoch +
|
|
||||||
')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,13 +26,4 @@ public record LoadedLogOffsets(long logStartOffset, long recoveryPoint, LogOffse
|
||||||
this.recoveryPoint = recoveryPoint;
|
this.recoveryPoint = recoveryPoint;
|
||||||
this.nextOffsetMetadata = Objects.requireNonNull(nextOffsetMetadata, "nextOffsetMetadata should not be null");
|
this.nextOffsetMetadata = Objects.requireNonNull(nextOffsetMetadata, "nextOffsetMetadata should not be null");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "LoadedLogOffsets(" +
|
|
||||||
"logStartOffset=" + logStartOffset +
|
|
||||||
", recoveryPoint=" + recoveryPoint +
|
|
||||||
", nextOffsetMetadata=" + nextOffsetMetadata +
|
|
||||||
')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,14 +23,4 @@ package org.apache.kafka.storage.internals.log;
|
||||||
*/
|
*/
|
||||||
public record LogOffsetSnapshot(long logStartOffset, LogOffsetMetadata logEndOffset, LogOffsetMetadata highWatermark,
|
public record LogOffsetSnapshot(long logStartOffset, LogOffsetMetadata logEndOffset, LogOffsetMetadata highWatermark,
|
||||||
LogOffsetMetadata lastStableOffset) {
|
LogOffsetMetadata lastStableOffset) {
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "LogOffsetSnapshot(" +
|
|
||||||
"logStartOffset=" + logStartOffset +
|
|
||||||
", logEndOffset=" + logEndOffset +
|
|
||||||
", highWatermark=" + highWatermark +
|
|
||||||
", lastStableOffset=" + lastStableOffset +
|
|
||||||
')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,16 +25,4 @@ import java.util.Optional;
|
||||||
*/
|
*/
|
||||||
public record LogReadInfo(FetchDataInfo fetchedData, Optional<FetchResponseData.EpochEndOffset> divergingEpoch,
|
public record LogReadInfo(FetchDataInfo fetchedData, Optional<FetchResponseData.EpochEndOffset> divergingEpoch,
|
||||||
long highWatermark, long logStartOffset, long logEndOffset, long lastStableOffset) {
|
long highWatermark, long logStartOffset, long logEndOffset, long lastStableOffset) {
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "LogReadInfo(" +
|
|
||||||
"fetchedData=" + fetchedData +
|
|
||||||
", divergingEpoch=" + divergingEpoch +
|
|
||||||
", highWatermark=" + highWatermark +
|
|
||||||
", logStartOffset=" + logStartOffset +
|
|
||||||
", logEndOffset=" + logEndOffset +
|
|
||||||
", lastStableOffset=" + lastStableOffset +
|
|
||||||
')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,12 +32,4 @@ public record OffsetPosition(long offset, int position) implements IndexEntry {
|
||||||
public long indexValue() {
|
public long indexValue() {
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "OffsetPosition(" +
|
|
||||||
"offset=" + offset +
|
|
||||||
", position=" + position +
|
|
||||||
')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,15 +22,4 @@ import org.apache.kafka.server.storage.log.FetchIsolation;
|
||||||
|
|
||||||
public record RemoteStorageFetchInfo(int fetchMaxBytes, boolean minOneMessage, TopicIdPartition topicIdPartition,
|
public record RemoteStorageFetchInfo(int fetchMaxBytes, boolean minOneMessage, TopicIdPartition topicIdPartition,
|
||||||
FetchRequest.PartitionData fetchInfo, FetchIsolation fetchIsolation) {
|
FetchRequest.PartitionData fetchInfo, FetchIsolation fetchIsolation) {
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "RemoteStorageFetchInfo{" +
|
|
||||||
"fetchMaxBytes=" + fetchMaxBytes +
|
|
||||||
", minOneMessage=" + minOneMessage +
|
|
||||||
", topicIdPartition=" + topicIdPartition +
|
|
||||||
", fetchInfo=" + fetchInfo +
|
|
||||||
", fetchIsolation=" + fetchIsolation +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,17 +21,4 @@ package org.apache.kafka.storage.internals.log;
|
||||||
*/
|
*/
|
||||||
public record RollParams(long maxSegmentMs, int maxSegmentBytes, long maxTimestampInMessages, long maxOffsetInMessages,
|
public record RollParams(long maxSegmentMs, int maxSegmentBytes, long maxTimestampInMessages, long maxOffsetInMessages,
|
||||||
int messagesSize, long now) {
|
int messagesSize, long now) {
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "RollParams(" +
|
|
||||||
"maxSegmentMs=" + maxSegmentMs +
|
|
||||||
", maxSegmentBytes=" + maxSegmentBytes +
|
|
||||||
", maxTimestampInMessages=" + maxTimestampInMessages +
|
|
||||||
", maxOffsetInMessages=" + maxOffsetInMessages +
|
|
||||||
", messagesSize=" + messagesSize +
|
|
||||||
", now=" + now +
|
|
||||||
')';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,11 +36,4 @@ public record TimestampOffset(long timestamp, long offset) implements IndexEntry
|
||||||
public long indexValue() {
|
public long indexValue() {
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return String.format("TimestampOffset(offset = %d, timestamp = %d)",
|
|
||||||
offset,
|
|
||||||
timestamp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue