KafkaRaftServer¶
KafkaRaftServer
is a Server for KRaft mode.
Creating Instance¶
KafkaRaftServer
takes the following to be created:
- KafkaConfig
-
Time
- Thread Name Prefix (optional)
KafkaRaftServer
is created when:
Kafka
command-line application is launched (and builds a server with no process.roles)
startup¶
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:
KafkaRaftServer
is created (and initializes metaProps and offlineDirs)
offlineDirs¶
offlineDirs: Seq[String]
KafkaRaftServer
initializes an offlineDirs
registry when created.
offlineDirs
is used when:
KafkaRaftServer
is requested for the broker (to create a BrokerServer)
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
:
- startup when
KafkaRaftServer
is requested to startup - shutdown when
KafkaRaftServer
is requested to shutdown - awaitShutdown when
KafkaRaftServer
is requested to awaitShutdown
ControllerServer¶
controller: Option[ControllerServer]
KafkaRaftServer
creates a ControllerServer when created with controller
in process.roles.
The lifecycle of ControllerServer
is tied up to KafkaRaftServer
:
- startup when
KafkaRaftServer
is requested to startup - shutdown when
KafkaRaftServer
is requested to shutdown - awaitShutdown when
KafkaRaftServer
is requested to awaitShutdown
SharedServer¶
KafkaRaftServer
creates a SharedServer when created.
The SharedServer
is used when running in KRaft mode to create the following:
- BrokerServer when configured as a broker
- ControllerServer when configured as a controller