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

Server
startup(): Unit

startup is part of the Server abstraction.

startup...FIXME

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:

ControllerServer

controller: Option[ControllerServer]

KafkaRaftServer creates a ControllerServer when created with controller in process.roles.

The lifecycle of ControllerServer is tied up to KafkaRaftServer:

SharedServer

KafkaRaftServer creates a SharedServer when created.

The SharedServer is used when running in KRaft mode to create the following: