mirror of https://github.com/apache/kafka.git
MINOR: Fix debug logs to display TimeIndexOffset (#13935)
Reviewers: Luke Chen <showuon@gmail.com>
This commit is contained in:
parent
d89b26ff44
commit
7d39d7400c
|
@ -66,7 +66,7 @@ public class TimeIndex extends AbstractIndex {
|
|||
this.lastEntry = lastEntryFromIndexFile();
|
||||
|
||||
log.debug("Loaded index file {} with maxEntries = {}, maxIndexSize = {}, entries = {}, lastOffset = {}, file position = {}",
|
||||
file.getAbsolutePath(), maxEntries(), maxIndexSize, entries(), lastEntry, mmap().position());
|
||||
file.getAbsolutePath(), maxEntries(), maxIndexSize, entries(), lastEntry.offset, mmap().position());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -278,7 +278,7 @@ public class TimeIndex extends AbstractIndex {
|
|||
super.truncateToEntries0(entries);
|
||||
this.lastEntry = lastEntryFromIndexFile();
|
||||
log.debug("Truncated index {} to {} entries; position is now {} and last entry is now {}",
|
||||
file().getAbsolutePath(), entries, mmap().position(), lastEntry);
|
||||
file().getAbsolutePath(), entries, mmap().position(), lastEntry.offset);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
|
|
@ -67,4 +67,11 @@ public class TimestampOffset implements IndexEntry {
|
|||
result = 31 * result + Long.hashCode(offset);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("TimestampOffset(offset = %d, timestamp = %d)",
|
||||
offset,
|
||||
timestamp);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue