OffsetIndex
is an index of the offsets of a LogSegment.
OffsetIndex
uses entrySize of 8 bytes (8-byte offset index entries).
OffsetIndex
is created when:
-
Lazily for a log segment (via forOffset utility that defers loading the underlying index file until needed)
-
DumpLogSegments tool is used (to dump the offset and time indices of a log segment)
Tip
|
Enable Add the following line to
Refer to Logging. |
OffsetIndex
takes the following to be created:
-
Underlying File
OffsetIndex
initializes the internal properties.
While being created, OffsetIndex
prints out the following DEBUG message to the logs:
Loaded index file [absolutePath] with maxEntries = [maxEntries], maxIndexSize = [maxIndexSize], entries = [_entries], lastOffset = [_lastOffset], file position = [position]
append(
offset: Long,
position: Int): Unit
append
…FIXME
lookup(
targetOffset: Long): OffsetPosition
lookup
…FIXME
Note
|
lookup is used when…FIXME
|
fetchUpperBoundOffset(
fetchOffset: OffsetPosition,
fetchSize: Int): Option[OffsetPosition]
fetchUpperBoundOffset
…FIXME
Note
|
fetchUpperBoundOffset is used when Log is requested to addAbortedTransactions.
|
truncateTo(
offset: Long): Unit
Note
|
truncateTo is part of the AbstractIndex Contract to…FIXME.
|
truncateTo
…FIXME
lastEntry: OffsetPosition
lastEntry
…FIXME
Note
|
lastEntry is used when…FIXME
|
Name | Description |
---|---|
|
The Used when…FIXME |