Election¶
Election is a utility with the algorithms for partition leader election.
leaderForOffline¶
leaderForOffline(
controllerContext: ControllerContext,
isLeaderRecoverySupported: Boolean,
partitionsWithUncleanLeaderRecoveryState: Seq[(TopicPartition, Option[LeaderAndIsr], Boolean)]
): Seq[ElectionResult] // (1)!
leaderForOffline(
partition: TopicPartition,
leaderAndIsrOpt: Option[LeaderAndIsr],
uncleanLeaderElectionEnabled: Boolean,
isLeaderRecoverySupported: Boolean,
controllerContext: ControllerContext): ElectionResult
- Uses the other
leaderForOfflinefor every tuple inpartitionsWithUncleanLeaderRecoveryState
leaderForOffline requests the given ControllerContext for the partition replicas and removes replicas that are not online.
For the input LeaderAndIsr defined, leaderForOffline offlinePartitionLeaderElection (with the replica brokers) and...FIXME
leaderForOffline is used when:
ZkPartitionStateMachineis requested to doElectLeaderForPartitions (with OfflinePartitionLeaderElectionStrategy)