Skip to content

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:

Reading Messages

read(
  startOffset: Long,
  maxSize: Int,
  maxPosition: Long = size,
  minOneMessage: Boolean = false): FetchDataInfo

read...FIXME

read is used when:

Back to top