LogSegment

LogSegment is a segment of a log.

LogSegment has two components: a log and an index (and with the base offset it would be stored in two files, a [base offset].index and a [base offset].log file).

LogSegment is created (indirectly using open) when:

Creating LogSegment Instance

LogSegment takes the following to be created:

  • FileRecords

  • LazyOffsetIndex

  • LazyTimeIndex

  • TransactionIndex

  • Base offset

  • indexIntervalBytes

  • rollJitterMs

  • Time

LogSegment initializes the internal properties.

recover Method

recover(
  producerStateManager: ProducerStateManager,
  leaderEpochCache: Option[LeaderEpochFileCache] = None): Int

recover…​FIXME

Note
recover is used when…​FIXME

sanityCheck Method

sanityCheck(timeIndexFileNewlyCreated: Boolean): Unit

sanityCheck…​FIXME

Note
sanityCheck is used when…​FIXME

Creating LogSegment Instance — open Factory Method

open(
  dir: File,
  baseOffset: Long,
  config: LogConfig,
  time: Time,
  fileAlreadyExists: Boolean = false,
  initFileSize: Int = 0,
  preallocate: Boolean = false,
  fileSuffix: String = ""): LogSegment

open…​FIXME

Note

open is used when:

resizeIndexes Method

resizeIndexes(size: Int): Unit

resizeIndexes…​FIXME

Note
resizeIndexes is used when…​FIXME

Internal Properties

Name Description

created

Time(stamp) when the LogSegment was created

Used when…​FIXME

bytesSinceLastIndexEntry

Used when…​FIXME

rollingBasedTimestamp

Used when…​FIXME

_maxTimestampSoFar

Used when…​FIXME

_offsetOfMaxTimestampSoFar

Used when…​FIXME

results matching ""

    No results matching ""