ReplicaStateMachine¶
Review Me¶
ReplicaStateMachine is the <
[[contract]] .ReplicaStateMachine Contract (Abstract Methods Only) [cols="30m,70",options="header",width="100%"] |=== | Method | Description
| handleStateChanges a| [[handleStateChanges]]
[source, scala]¶
handleStateChanges( replicas: Seq[PartitionAndReplica], targetState: ReplicaState): Unit
Handles state changes of replicas (replica state changes)
Used when:
-
KafkaControlleris requested to <>, < >, < >, < >, < >, < >, < >, and < > -
ReplicaStateMachineis requested to <> (when KafkaControlleris requested to <> on a broker elected as the controller) -
TopicDeletionManageris requested to <>, < >, < >, < >, and < >
|===
[[implementations]] NOTE: <
[[creating-instance]][[controllerContext]] ReplicaStateMachine takes a single <
NOTE: ReplicaStateMachine is a Scala abstract class and cannot be <
=== [[shutdown]] Shutting Down -- shutdown Method
[source, scala]¶
shutdown(): Unit¶
shutdown simply prints out the following INFO message to the logs:
Stopped replica state machine
NOTE: shutdown is used exclusively when KafkaController is requested to <
=== [[startup]] Starting Up (On Active Controller) -- startup Method
[source, scala]¶
startup(): Unit¶
startup prints out the following INFO message to the logs:
Initializing replica state
startup <
startup prints out the following INFO message to the logs:
Triggering online replica state changes
startup requests the <
startup <OnlineReplica target state).
startup prints out the following INFO message to the logs:
Triggering offline replica state changes
startup <OfflineReplica target state).
In the end, startup prints out the following DEBUG message to the logs:
Started replica state machine with initial state -> [replicaState]
NOTE: startup is used exclusively when KafkaController is requested to <
=== [[initializeReplicaState]] Initializing Partition Replica States using ControllerContext -- initializeReplicaState Internal Method
[source, scala]¶
initializeReplicaState(): Unit¶
initializeReplicaState requests the <
For every partition, initializeReplicaState requests the <
For every partition replica, initializeReplicaState requests the <OnlineReplica or ReplicaDeletionIneligible per <
NOTE: initializeReplicaState is used exclusively when ReplicaStateMachine is requested to <