Skip to content

KafkaRaftServer

KafkaRaftServer is a Server for KRaft mode.

Creating Instance

KafkaRaftServer takes the following to be created:

KafkaRaftServer is created when:

startup

startup(): Unit

startup...FIXME

startup is part of the Server abstraction.

initializeLogDirs

initializeLogDirs(
  config: KafkaConfig): (MetaProperties, Seq[String])

initializeLogDirs uses the log.dirs (if defined) or log.dir and metadata.log.dir for the log directories (logDirs).

initializeLogDirs getBrokerMetadataAndOfflineDirs the log directories (into rawMetaProperties and offlineDirs).

Note

metadata.log.dir is not allowed to be among the offline directories (offlineDirs) or a KafkaException is thrown:

Cannot start server since `meta.properties` could not be loaded from [metadataLogDir]

initializeLogDirs...FIXME


initializeLogDirs is used when:

offlineDirs

offlineDirs: Seq[String]

KafkaRaftServer initializes an offlineDirs registry when created.

offlineDirs is used when:

metaProps

metaProps: MetaProperties

KafkaRaftServer creates a MetaProperties when created.

metaProps is used to initialize the other KafkaRaftServer services:

BrokerServer

broker: Option[BrokerServer]

KafkaRaftServer creates a BrokerServer when created with BrokerRole.

The lifecycle of BrokerServer is tied up to KafkaRaftServer: