Skip to content

Commit d2a6999

Browse files
authored
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 <[email protected]>
1 parent 41611b4 commit d2a6999

File tree

9 files changed

+0
-86
lines changed

9 files changed

+0
-86
lines changed

storage/src/main/java/org/apache/kafka/storage/internals/log/EpochEntry.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,4 @@
1818

1919
// Mapping of epoch to the first offset of the subsequent epoch
2020
public record EpochEntry(int epoch, long startOffset) {
21-
22-
@Override
23-
public String toString() {
24-
return "EpochEntry(" +
25-
"epoch=" + epoch +
26-
", startOffset=" + startOffset +
27-
')';
28-
}
2921
}

storage/src/main/java/org/apache/kafka/storage/internals/log/LastRecord.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,4 @@ public record LastRecord(OptionalLong lastDataOffset, short producerEpoch) {
2727
public LastRecord {
2828
Objects.requireNonNull(lastDataOffset, "lastDataOffset must be non null");
2929
}
30-
31-
@Override
32-
public String toString() {
33-
return "LastRecord(" +
34-
"lastDataOffset=" + lastDataOffset +
35-
", producerEpoch=" + producerEpoch +
36-
')';
37-
}
3830
}

storage/src/main/java/org/apache/kafka/storage/internals/log/LoadedLogOffsets.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,4 @@ public LoadedLogOffsets(final long logStartOffset,
2626
this.recoveryPoint = recoveryPoint;
2727
this.nextOffsetMetadata = Objects.requireNonNull(nextOffsetMetadata, "nextOffsetMetadata should not be null");
2828
}
29-
30-
@Override
31-
public String toString() {
32-
return "LoadedLogOffsets(" +
33-
"logStartOffset=" + logStartOffset +
34-
", recoveryPoint=" + recoveryPoint +
35-
", nextOffsetMetadata=" + nextOffsetMetadata +
36-
')';
37-
}
3829
}

storage/src/main/java/org/apache/kafka/storage/internals/log/LogOffsetSnapshot.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,4 @@
2323
*/
2424
public record LogOffsetSnapshot(long logStartOffset, LogOffsetMetadata logEndOffset, LogOffsetMetadata highWatermark,
2525
LogOffsetMetadata lastStableOffset) {
26-
27-
@Override
28-
public String toString() {
29-
return "LogOffsetSnapshot(" +
30-
"logStartOffset=" + logStartOffset +
31-
", logEndOffset=" + logEndOffset +
32-
", highWatermark=" + highWatermark +
33-
", lastStableOffset=" + lastStableOffset +
34-
')';
35-
}
3626
}

storage/src/main/java/org/apache/kafka/storage/internals/log/LogReadInfo.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,4 @@
2525
*/
2626
public record LogReadInfo(FetchDataInfo fetchedData, Optional<FetchResponseData.EpochEndOffset> divergingEpoch,
2727
long highWatermark, long logStartOffset, long logEndOffset, long lastStableOffset) {
28-
29-
@Override
30-
public String toString() {
31-
return "LogReadInfo(" +
32-
"fetchedData=" + fetchedData +
33-
", divergingEpoch=" + divergingEpoch +
34-
", highWatermark=" + highWatermark +
35-
", logStartOffset=" + logStartOffset +
36-
", logEndOffset=" + logEndOffset +
37-
", lastStableOffset=" + lastStableOffset +
38-
')';
39-
}
4028
}

storage/src/main/java/org/apache/kafka/storage/internals/log/OffsetPosition.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,4 @@ public long indexKey() {
3232
public long indexValue() {
3333
return position;
3434
}
35-
36-
@Override
37-
public String toString() {
38-
return "OffsetPosition(" +
39-
"offset=" + offset +
40-
", position=" + position +
41-
')';
42-
}
4335
}

storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteStorageFetchInfo.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,4 @@
2222

2323
public record RemoteStorageFetchInfo(int fetchMaxBytes, boolean minOneMessage, TopicIdPartition topicIdPartition,
2424
FetchRequest.PartitionData fetchInfo, FetchIsolation fetchIsolation) {
25-
26-
@Override
27-
public String toString() {
28-
return "RemoteStorageFetchInfo{" +
29-
"fetchMaxBytes=" + fetchMaxBytes +
30-
", minOneMessage=" + minOneMessage +
31-
", topicIdPartition=" + topicIdPartition +
32-
", fetchInfo=" + fetchInfo +
33-
", fetchIsolation=" + fetchIsolation +
34-
'}';
35-
}
3625
}

storage/src/main/java/org/apache/kafka/storage/internals/log/RollParams.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,4 @@
2121
*/
2222
public record RollParams(long maxSegmentMs, int maxSegmentBytes, long maxTimestampInMessages, long maxOffsetInMessages,
2323
int messagesSize, long now) {
24-
25-
@Override
26-
public String toString() {
27-
return "RollParams(" +
28-
"maxSegmentMs=" + maxSegmentMs +
29-
", maxSegmentBytes=" + maxSegmentBytes +
30-
", maxTimestampInMessages=" + maxTimestampInMessages +
31-
", maxOffsetInMessages=" + maxOffsetInMessages +
32-
", messagesSize=" + messagesSize +
33-
", now=" + now +
34-
')';
35-
}
36-
3724
}

storage/src/main/java/org/apache/kafka/storage/internals/log/TimestampOffset.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,4 @@ public long indexKey() {
3636
public long indexValue() {
3737
return offset;
3838
}
39-
40-
@Override
41-
public String toString() {
42-
return String.format("TimestampOffset(offset = %d, timestamp = %d)",
43-
offset,
44-
timestamp);
45-
}
4639
}

0 commit comments

Comments
 (0)