LogSegment¶
Creating Instance¶
LogSegment
takes the following to be created:
-
FileRecords
-
OffsetIndex
-
TimeIndex
-
TransactionIndex
- baseOffset
- indexIntervalBytes
- rollJitterMs
-
Time
LogSegment
is created using open utility.
Opening LogSegment¶
open(
dir: File,
baseOffset: Long,
config: LogConfig,
time: Time,
fileAlreadyExists: Boolean = false,
initFileSize: Int = 0,
preallocate: Boolean = false,
fileSuffix: String = ""): LogSegment
open
...FIXME
open
is used when:
LocalLog
is requested to createAndDeleteSegment, roll, createNewCleanedSegmentLogLoader
is requested to load, loadSegmentFiles, recoverLog
Reading Messages¶
read(
startOffset: Long,
maxSize: Int,
maxPosition: Long = size,
minOneMessage: Boolean = false): FetchDataInfo
read
...FIXME
read
is used when:
Log
is requested to readLogSegment
is requested to readNextOffset