diff --git a/kafka-controller-ControllerContext.adoc b/kafka-controller-ControllerContext.adoc index 0acd81d..1044bbd 100644 --- a/kafka-controller-ControllerContext.adoc +++ b/kafka-controller-ControllerContext.adoc @@ -274,9 +274,11 @@ NOTE: `putPartitionState` is used when...FIXME ---- partitionsInStates( states: Set[PartitionState]): Set[TopicPartition] +partitionsInStates( + topic: String, states: Set[PartitionState]): Set[TopicPartition] ---- -`partitionsInStates` uses the <> internal registry to find all of the `TopicPartitions` in the given `PartitionStates`. +`partitionsInStates` uses the <> internal registry to find all of the `TopicPartitions` (of the topic if defined) in the given `PartitionStates`. NOTE: `partitionsInStates` is used when `PartitionStateMachine` is requested to link:kafka-controller-PartitionStateMachine.adoc#triggerOnlinePartitionStateChange[triggerOnlinePartitionStateChange]. @@ -344,7 +346,7 @@ The timer metric name pattern is *kafka.controller:type=ControllerStats,name=*. a| [[topicsIneligibleForDeletion]] | topicsToBeDeleted -a| [[topicsToBeDeleted]] +a| [[topicsToBeDeleted]][[isTopicQueuedUpForDeletion]] | topicsWithDeletionStarted a| [[topicsWithDeletionStarted]] diff --git a/kafka-controller-KafkaController.adoc b/kafka-controller-KafkaController.adoc index d56cee9..cf03498 100644 --- a/kafka-controller-KafkaController.adoc +++ b/kafka-controller-KafkaController.adoc @@ -1484,13 +1484,28 @@ NOTE: `checkAndTriggerAutoLeaderRebalance` is used exclusively when `KafkaContro [source, scala] ---- -onNewPartitionCreation(newPartitions: Set[TopicPartition]): Unit +onNewPartitionCreation( + newPartitions: Set[TopicPartition]): Unit ---- `onNewPartitionCreation`...FIXME NOTE: `onNewPartitionCreation` is used when <> and <> controller events are processed. +=== [[onReplicaElection]] `onReplicaElection` Internal Method + +[source, scala] +---- +onReplicaElection( + partitions: Set[TopicPartition], + electionType: ElectionType, + electionTrigger: ElectionTrigger): Map[TopicPartition, Either[Throwable, LeaderAndIsr]] +---- + +`onReplicaElection`...FIXME + +NOTE: `onReplicaElection` is used when...FIXME + === [[onBrokerLogDirFailure]] Handling Log Directory Failures for Brokers -- `onBrokerLogDirFailure` Internal Method [source, scala] @@ -1643,7 +1658,7 @@ processTopicUncleanLeaderElectionEnable(topic: String): Unit `processTopicUncleanLeaderElectionEnable`...FIXME -NOTE: `processTopicUncleanLeaderElectionEnable` is used exclusively when `KafkaController` is requested to <>. +NOTE: `processTopicUncleanLeaderElectionEnable` is used when `KafkaController` is requested to <>. === [[processLeaderAndIsrResponseReceived]] Processing LeaderAndIsrResponseReceived Controller Event (On controller-event-thread) -- `processLeaderAndIsrResponseReceived` Internal Method diff --git a/kafka-controller-PartitionStateMachine.adoc b/kafka-controller-PartitionStateMachine.adoc index 3d66550..262066f 100644 --- a/kafka-controller-PartitionStateMachine.adoc +++ b/kafka-controller-PartitionStateMachine.adoc @@ -55,7 +55,15 @@ NOTE: `PartitionStateMachine` is a Scala abstract class and cannot be <> (with the `allowUnclean` flag off) | PreferredReplicaPartitionLeaderElectionStrategy a| [[PreferredReplicaPartitionLeaderElectionStrategy]] `KafkaController` is requested for <> that in turn triggers `ZkPartitionStateMachine` to <> @@ -71,18 +79,21 @@ a| [[ReassignPartitionLeaderElectionStrategy]] ---- triggerOnlinePartitionStateChange(): Unit triggerOnlinePartitionStateChange( - topic: String): Unit + topic: String): Unit // <1> ---- +<1> Uses the partitions of the given topic only `triggerOnlinePartitionStateChange` requests the <> for the link:kafka-controller-ControllerContext.adoc#partitionsInStates[partitions in the states]: `OfflinePartition` and `NewPartition`. +With the topic specified, `triggerOnlinePartitionStateChange` requests the <> for the link:kafka-controller-ControllerContext.adoc#partitionsInStates[partitions of the topic in the states]: `OfflinePartition` and `NewPartition`. + In the end, `triggerOnlinePartitionStateChange` <>. [NOTE] ==== `triggerOnlinePartitionStateChange` is used when: -* `KafkaController` is requested to link:kafka-controller-KafkaController.adoc#onBrokerStartup[onBrokerStartup], link:kafka-controller-KafkaController.adoc#onReplicasBecomeOffline[onReplicasBecomeOffline] and link:kafka-controller-KafkaController.adoc#processUncleanLeaderElectionEnable[processUncleanLeaderElectionEnable] +* `KafkaController` is requested to link:kafka-controller-KafkaController.adoc#onBrokerStartup[onBrokerStartup], link:kafka-controller-KafkaController.adoc#onReplicasBecomeOffline[onReplicasBecomeOffline], link:kafka-controller-KafkaController.adoc#processUncleanLeaderElectionEnable[processUncleanLeaderElectionEnable], link:kafka-controller-KafkaController.adoc#processTopicUncleanLeaderElectionEnable[processTopicUncleanLeaderElectionEnable] * `PartitionStateMachine` is requested to <> ==== @@ -95,9 +106,9 @@ triggerOnlineStateChangeForPartitions( partitions: collection.Set[TopicPartition]): Unit ---- -`triggerOnlineStateChangeForPartitions`...FIXME +`triggerOnlineStateChangeForPartitions` filters out the partitions of the link:kafka-controller-ControllerContext.adoc#isTopicQueuedUpForDeletion[topics to be deleted] and tries to <> to `OnlinePartition` state with <> (with `allowUnclean` flag off). -NOTE: `triggerOnlineStateChangeForPartitions` is used when...FIXME +NOTE: `triggerOnlineStateChangeForPartitions` is used when `PartitionStateMachine` is requested to <>. === [[shutdown]] Shutting Down -- `shutdown` Method